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

Explicitly return each generated video filepath from test_stage_2.py #51

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

ansonkao
Copy link
Contributor

@ansonkao ansonkao commented Jun 11, 2024

Enable this repo to be imported into other codebases for different handling of queueing, etc.

test_stage_2.py Outdated
Comment on lines 223 to 231
# video = torch.cat([ref_image_tensor, pose_tensor[:,:,:L], video[:,:,:L]], dim=0)
# video = scale_video(video, original_width, original_height)
# output_path2 = f"{save_dir}/{ref_name}_{pose_name}_{cfg}_{steps}_{skip}_{m1}_{m2}.mp4"
# save_videos_grid(
# video,
# output_path2,
# n_rows=3,
# fps=src_fps if fps is None else fps,
# )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented this out, because I was consistently getting the following error:

Traceback (most recent call last):
  File "/root/test_stage_2.py", line 238, in <module>
    main()
  File "/root/test_stage_2.py", line 232, in main
    handle_single(ref_image_path, pose_video_path) 
  File "/root/test_stage_2.py", line 211, in handle_single
    video = torch.cat([ref_image_tensor, pose_tensor[:,:,:L], video[:,:,:L]], dim=0) 
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 540 but got size 536 for tensor number 2 in the list.

The way the code was saving outputs to the disk before, these errors would fail silently. But with this PR, they will be blocking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized the cause: This is for video generations that are 16:9 aspect ratio, e.g. 960 height and 540 width. 540 converted to latent space is halfway between 536 and 544...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solved by choosing a different height and width

@ansonkao ansonkao marked this pull request as ready for review June 12, 2024 03:11
@ansonkao ansonkao changed the title Make test_stage_2.py callable as a function Explicitly return each generated video filepath from test_stage_2.py Jun 12, 2024
@ansonkao
Copy link
Contributor Author

TODO: update docs

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