issue with cat_and_write_video

This commit is contained in:
Cadene 2024-03-26 10:12:16 +00:00
parent 1a1308d62f
commit 4a8c5e238e
1 changed files with 1 additions and 2 deletions

View File

@ -27,8 +27,7 @@ def visualize_dataset_cli(cfg: dict):
def cat_and_write_video(video_path, frames, fps):
# Expects images in [0, 255].
frames = torch.cat(frames)
assert frames.max() <= 1 and frames.min() >= 0
frames = (255 * frames).to(dtype=torch.uint8)
assert frames.dtype == torch.uint8
frames = einops.rearrange(frames, "b c h w -> b h w c").numpy()
imageio.mimsave(video_path, frames, fps=fps)