Skip to content

Fix SVD image input#321

Open
TianxingWu wants to merge 1 commit intoStability-AI:mainfrom
TianxingWu:debug
Open

Fix SVD image input#321
TianxingWu wants to merge 1 commit intoStability-AI:mainfrom
TianxingWu:debug

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