Spaces:
Runtime error
Runtime error
jhj0517
commited on
Commit
·
930c751
1
Parent(s):
1de582e
clean temp/out dir
Browse files- modules/video_utils.py +8 -1
modules/video_utils.py
CHANGED
|
@@ -212,10 +212,17 @@ def get_frames_from_dir(vid_dir: str,
|
|
| 212 |
return frames
|
| 213 |
|
| 214 |
|
| 215 |
-
def clean_temp_dir(temp_dir: str =
|
| 216 |
"""Removes media files from the directory."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
clean_sound_files(temp_dir)
|
| 218 |
clean_image_files(temp_dir)
|
|
|
|
| 219 |
|
| 220 |
|
| 221 |
def clean_sound_files(sound_dir: str):
|
|
|
|
| 212 |
return frames
|
| 213 |
|
| 214 |
|
| 215 |
+
def clean_temp_dir(temp_dir: Optional[str] = None):
|
| 216 |
"""Removes media files from the directory."""
|
| 217 |
+
if temp_dir is None:
|
| 218 |
+
temp_dir = TEMP_DIR
|
| 219 |
+
temp_out_dir = TEMP_OUT_DIR
|
| 220 |
+
else:
|
| 221 |
+
temp_out_dir = os.path.join(temp_dir, "out")
|
| 222 |
+
|
| 223 |
clean_sound_files(temp_dir)
|
| 224 |
clean_image_files(temp_dir)
|
| 225 |
+
clean_image_files(temp_out_dir)
|
| 226 |
|
| 227 |
|
| 228 |
def clean_sound_files(sound_dir: str):
|