Spaces:
Runtime error
Runtime error
Commit
·
b9ae405
1
Parent(s):
db10df2
Update utils.py
Browse files
utils.py
CHANGED
@@ -16,7 +16,7 @@ from kornia.utils.grid import create_meshgrid
|
|
16 |
import cv2
|
17 |
|
18 |
def save_video_frames(video_path, img_size=(512,512)):
|
19 |
-
video, _,
|
20 |
# rotate video -90 degree if video is .mov format. this is a weird bug in torchvision
|
21 |
if video_path.endswith('.mov'):
|
22 |
video = T.functional.rotate(video, -90)
|
@@ -29,7 +29,8 @@ def save_video_frames(video_path, img_size=(512,512)):
|
|
29 |
image_resized.save(f'data/{video_name}/{ind}.png')
|
30 |
|
31 |
def video_to_frames(video_path, img_size=(512,512)):
|
32 |
-
video, _,
|
|
|
33 |
# rotate video -90 degree if video is .mov format. this is a weird bug in torchvision
|
34 |
if video_path.endswith('.mov'):
|
35 |
video = T.functional.rotate(video, -90)
|
|
|
16 |
import cv2
|
17 |
|
18 |
def save_video_frames(video_path, img_size=(512,512)):
|
19 |
+
video, _, = read_video(video_path, output_format="TCHW")
|
20 |
# rotate video -90 degree if video is .mov format. this is a weird bug in torchvision
|
21 |
if video_path.endswith('.mov'):
|
22 |
video = T.functional.rotate(video, -90)
|
|
|
29 |
image_resized.save(f'data/{video_name}/{ind}.png')
|
30 |
|
31 |
def video_to_frames(video_path, img_size=(512,512)):
|
32 |
+
video, _, video_info = read_video(video_path, output_format="TCHW")
|
33 |
+
print(video_info["fps"])
|
34 |
# rotate video -90 degree if video is .mov format. this is a weird bug in torchvision
|
35 |
if video_path.endswith('.mov'):
|
36 |
video = T.functional.rotate(video, -90)
|