Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visualize.py error #7

Open
dubrovin-sudo opened this issue Oct 13, 2023 · 2 comments
Open

visualize.py error #7

dubrovin-sudo opened this issue Oct 13, 2023 · 2 comments

Comments

@dubrovin-sudo
Copy link

Try to render a video from the trained model, but got error @bebeal @ninaahmed

Full log after visualize.py implementation

/home/trillion/miniconda3/envs/mipNeRF/bin/python visualize.py
Generating Render Poses
Generating rays
Done

Generating Video using 120 different view points
100%|██████████| 120/120 [57:49<00:00, 28.92s/it]
Traceback (most recent call last):
File "visualize.py", line 59, in
visualize(config)
File "visualize.py", line 50, in visualize
imageio.mimwrite(path.join(config.log_dir, "video.mp4"), rgb_frames, fps=30, quality=10, codecs="hvec")
File "/home/trillion/miniconda3/envs/mipNeRF/lib/python3.7/site-packages/imageio/v2.py", line 331, in mimwrite
return file.write(ims, **kwargs)
File "/home/trillion/miniconda3/envs/mipNeRF/lib/python3.7/site-packages/imageio/core/legacy_plugin_wrapper.py", line 182, in write
with self.legacy_get_writer(**kwargs) as writer:
File "/home/trillion/miniconda3/envs/mipNeRF/lib/python3.7/site-packages/imageio/core/legacy_plugin_wrapper.py", line 163, in legacy_get_writer
return self._format.get_writer(self._request)
File "/home/trillion/miniconda3/envs/mipNeRF/lib/python3.7/site-packages/imageio/core/format.py", line 234, in get_writer
return self.Writer(self, request)
File "/home/trillion/miniconda3/envs/mipNeRF/lib/python3.7/site-packages/imageio/core/format.py", line 311, in init
self._open(**self.request.kwargs.copy())
TypeError: _open() got an unexpected keyword argument 'codecs'

What I gotta do with codecs?

@DrawingProcess
Copy link

I got a same issue. Did you solve it?

@DrawingProcess
Copy link

Solved it! Modify visualize.py as shown below.

    imageio.mimwrite(path.join(config.log_dir, "video.mp4"), rgb_frames, fps=30, quality=5, codec="h264")
    if config.visualize_depth:
        imageio.mimwrite(path.join(config.log_dir, "depth.mp4"), depth_frames, fps=30, quality=5, codec="h264")
    if config.visualize_normals:
        imageio.mimwrite(path.join(config.log_dir, "normals.mp4"), normal_frames, fps=30, quality=5, codec="h264")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants