Spaces:
Runtime error
Runtime error
jhj0517
commited on
Commit
·
6431157
1
Parent(s):
cfc3ad2
Update function logic
Browse files- modules/video_utils.py +2 -0
modules/video_utils.py
CHANGED
@@ -47,5 +47,7 @@ def get_frames_from_dir(vid_dir: str,
|
|
47 |
p for p in os.listdir(vid_dir)
|
48 |
if os.path.splitext(p)[-1] in available_extensions
|
49 |
]
|
|
|
|
|
50 |
frame_names.sort(key=lambda x: int(os.path.splitext(x)[0]))
|
51 |
return frame_names
|
|
|
47 |
p for p in os.listdir(vid_dir)
|
48 |
if os.path.splitext(p)[-1] in available_extensions
|
49 |
]
|
50 |
+
if not frame_names:
|
51 |
+
return []
|
52 |
frame_names.sort(key=lambda x: int(os.path.splitext(x)[0]))
|
53 |
return frame_names
|