Spaces:
Runtime error
Runtime error
Update video_processing.py
Browse files- video_processing.py +11 -2
video_processing.py
CHANGED
|
@@ -214,17 +214,26 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
| 214 |
if progress is not None:
|
| 215 |
progress(0.95, desc="Generating video with heatmap")
|
| 216 |
|
| 217 |
-
output_folder = "output"
|
|
|
|
| 218 |
heatmap_video_path = create_video_with_heatmap(
|
| 219 |
video_path, df, mse_embeddings, mse_posture, mse_voice,
|
| 220 |
output_folder, original_fps, largest_cluster,
|
| 221 |
progress=progress
|
| 222 |
)
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
if progress is not None:
|
| 225 |
progress(1.0, desc="Video processing complete")
|
|
|
|
| 226 |
except Exception as e:
|
| 227 |
print(f"Error in create_video_with_heatmap: {str(e)}")
|
|
|
|
|
|
|
| 228 |
heatmap_video_path = None
|
| 229 |
|
| 230 |
|
|
|
|
| 214 |
if progress is not None:
|
| 215 |
progress(0.95, desc="Generating video with heatmap")
|
| 216 |
|
| 217 |
+
output_folder = "output"
|
| 218 |
+
os.makedirs(output_folder, exist_ok=True)
|
| 219 |
heatmap_video_path = create_video_with_heatmap(
|
| 220 |
video_path, df, mse_embeddings, mse_posture, mse_voice,
|
| 221 |
output_folder, original_fps, largest_cluster,
|
| 222 |
progress=progress
|
| 223 |
)
|
| 224 |
+
print(f"Heatmap video path from create_video_with_heatmap: {heatmap_video_path}")
|
| 225 |
+
|
| 226 |
+
if not os.path.exists(heatmap_video_path):
|
| 227 |
+
raise FileNotFoundError(f"Heatmap video file not found at {heatmap_video_path}")
|
| 228 |
+
|
| 229 |
+
|
| 230 |
if progress is not None:
|
| 231 |
progress(1.0, desc="Video processing complete")
|
| 232 |
+
|
| 233 |
except Exception as e:
|
| 234 |
print(f"Error in create_video_with_heatmap: {str(e)}")
|
| 235 |
+
import traceback
|
| 236 |
+
traceback.print_exc()
|
| 237 |
heatmap_video_path = None
|
| 238 |
|
| 239 |
|