Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
60630de
1
Parent(s):
9d85ab3
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -30,9 +30,6 @@ def save_video_frames(video_path, img_size=(512,512)):
|
|
| 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)
|
| 34 |
-
print(video_info["video_fps"])
|
| 35 |
-
|
| 36 |
|
| 37 |
# rotate video -90 degree if video is .mov format. this is a weird bug in torchvision
|
| 38 |
if video_path.endswith('.mov'):
|
|
@@ -46,7 +43,7 @@ def video_to_frames(video_path, img_size=(512,512)):
|
|
| 46 |
image_resized = image.resize((img_size), resample=Image.Resampling.LANCZOS)
|
| 47 |
# image_resized.save(f'data/{video_name}/{ind}.png')
|
| 48 |
frames.append(image_resized)
|
| 49 |
-
return frames
|
| 50 |
|
| 51 |
def add_dict_to_yaml_file(file_path, key, value):
|
| 52 |
data = {}
|
|
|
|
| 30 |
|
| 31 |
def video_to_frames(video_path, img_size=(512,512)):
|
| 32 |
video, _, video_info = read_video(video_path, output_format="TCHW")
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
# rotate video -90 degree if video is .mov format. this is a weird bug in torchvision
|
| 35 |
if video_path.endswith('.mov'):
|
|
|
|
| 43 |
image_resized = image.resize((img_size), resample=Image.Resampling.LANCZOS)
|
| 44 |
# image_resized.save(f'data/{video_name}/{ind}.png')
|
| 45 |
frames.append(image_resized)
|
| 46 |
+
return frames, video_info["video_fps"]
|
| 47 |
|
| 48 |
def add_dict_to_yaml_file(file_path, key, value):
|
| 49 |
data = {}
|