Update app.py
Browse files
app.py
CHANGED
@@ -20,6 +20,7 @@ import tempfile
|
|
20 |
import shutil
|
21 |
import subprocess
|
22 |
import fractions
|
|
|
23 |
|
24 |
# Suppress TensorFlow warnings
|
25 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
|
@@ -349,6 +350,8 @@ def get_random_face_sample(organized_faces_folder, largest_cluster, output_folde
|
|
349 |
return output_path
|
350 |
return None
|
351 |
|
|
|
|
|
352 |
def process_video(video_path, num_anomalies, num_components, desired_fps, batch_size, progress=gr.Progress()):
|
353 |
output_folder = "output"
|
354 |
os.makedirs(output_folder, exist_ok=True)
|
|
|
20 |
import shutil
|
21 |
import subprocess
|
22 |
import fractions
|
23 |
+
import spaces
|
24 |
|
25 |
# Suppress TensorFlow warnings
|
26 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
|
|
|
350 |
return output_path
|
351 |
return None
|
352 |
|
353 |
+
@spaces.GPU(duration=300) # Set to 5 minutes (300 seconds)
|
354 |
+
|
355 |
def process_video(video_path, num_anomalies, num_components, desired_fps, batch_size, progress=gr.Progress()):
|
356 |
output_folder = "output"
|
357 |
os.makedirs(output_folder, exist_ok=True)
|