Spaces:
Configuration error
Configuration error
File size: 720 Bytes
97e3689 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import os
from detection.utils import get_static_file_url
def run(*args, **kwargs):
image_folder_path = get_static_file_url("images")
image_files = os.listdir(image_folder_path)
print(f"Removing {len(image_files)} images ...")
for file in image_files:
file_path = os.path.join(image_folder_path, file)
os.remove(file_path)
print("Finished clear the image folder.")
video_folder_path = get_static_file_url("media")
video_files = os.listdir(video_folder_path)
print(f"Removing {len(video_files)} videos ...")
for file in video_files:
file_path = os.path.join(video_folder_path, file)
os.remove(file_path)
print("Finished clear the video folder.")
|