Spaces:
Paused
Paused
Commit ·
b9ae405
1
Parent(s): db10df2
Update utils.py
Browse files15 unmodified lines161718192021226 unmodified lines2930313233343515 unmodified linesimport cv2def save_video_frames(video_path, img_size=(512,512)):video, _, _ = read_video(video_path, output_format="TCHW")# rotate video -90 degree if video is .mov format. this is a weird bug in torchvisionif video_path.endswith('.mov'):video = T.functional.rotate(video, -90)6 unmodified linesimage_resized.save(f'data/{video_name}/{ind}.png')def video_to_frames(video_path, img_size=(512,512)):video, _, _ = read_video(video_path, output_format="TCHW")# rotate video -90 degree if video is .mov format. this is a weird bug in torchvisionif video_path.endswith('.mov'):video = T.functional.rotate(video, -90)15 unmodified lines161718192021226 unmodified lines293031323334353615 unmodified linesimport cv2def save_video_frames(video_path, img_size=(512,512)):video, _, = read_video(video_path, output_format="TCHW")# rotate video -90 degree if video is .mov format. this is a weird bug in torchvisionif video_path.endswith('.mov'):video = T.functional.rotate(video, -90)6 unmodified linesimage_resized.save(f'data/{video_name}/{ind}.png')def video_to_frames(video_path, img_size=(512,512)):video, _, video_info = read_video(video_path, output_format="TCHW")print(video_info["fps"])# rotate video -90 degree if video is .mov format. this is a weird bug in torchvisionif video_path.endswith('.mov'):video = T.functional.rotate(video, -90)
utils.py+3-2