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

Fix SVD image input #321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

TianxingWu
Copy link

Found a bug of SVD after the SV3D update:

If the input is a RGB image for SVD, The variable 'input_image' will not be assigned and raises:

UnboundLocalError: local variable 'input_image' referenced before assignment

Using copy() rather than direct assignment, or the following error will raise since the file is closed by the 'with' context manager:

TypeError: int() argument must be a string, a bytes-like object or a real number, not 'PngImageFile'

@TianxingWu
Copy link
Author

Another suggestion is to use torchivision.io.write_video() rather than imageio.mimwrite() to save the video. The current output cannot take fps into account and is not compatible with many video players. For example:

from torchvision.io import write_video
...
write_video(video_path, vid, fps=fps_id + 1)

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

Successfully merging this pull request may close these issues.

1 participant