Skip to content

fix: save_video for sample_batch #32

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hymm_sp/sample_batch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import torch
import numpy as np
import imageio
from pathlib import Path
from loguru import logger
from einops import rearrange
Expand Down Expand Up @@ -96,8 +97,7 @@ def main():
final_frames = np.stack(final_frames, axis=0)

if rank == 0:
from hymm_sp.data_kits.ffmpeg_utils import save_video
save_video(final_frames, output_path, n_rows=len(final_frames), fps=fps.item())
imageio.mimsave(output_path, final_frames, fps=fps.item())
os.system(f"ffmpeg -i '{output_path}' -i '{audio_path}' -shortest '{output_audio_path}' -y -loglevel quiet; rm '{output_path}'")


Expand Down