Spaces:
Runtime error
Runtime error
Update video_processing.py
Browse files- video_processing.py +6 -4
video_processing.py
CHANGED
|
@@ -200,11 +200,13 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
| 200 |
mse_heatmap_posture = plot_mse_heatmap(mse_posture, "Body Posture MSE Heatmap", df)
|
| 201 |
mse_heatmap_voice = plot_mse_heatmap(mse_voice, "Voice MSE Heatmap", df)
|
| 202 |
|
| 203 |
-
progress
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
-
# Create video with heatmap
|
| 206 |
-
heatmap_video_path = os.path.join(output_folder, "heatmap_video.mp4")
|
| 207 |
-
heatmap_video_path = create_video_with_heatmap(video_path, df, mse_embeddings, mse_posture, mse_voice, heatmap_video_path, original_fps, largest_cluster)
|
| 208 |
|
| 209 |
except Exception as e:
|
| 210 |
print(f"Error details: {str(e)}")
|
|
|
|
| 200 |
mse_heatmap_posture = plot_mse_heatmap(mse_posture, "Body Posture MSE Heatmap", df)
|
| 201 |
mse_heatmap_voice = plot_mse_heatmap(mse_voice, "Voice MSE Heatmap", df)
|
| 202 |
|
| 203 |
+
if progress:
|
| 204 |
+
progress(0.95, "Generating video with heatmap")
|
| 205 |
+
|
| 206 |
+
heatmap_video_path = create_video_with_heatmap(video_path, df, mse_embeddings, mse_posture, mse_voice,
|
| 207 |
+
heatmap_video_path, original_fps, largest_cluster,
|
| 208 |
+
progress=lambda p, desc: progress(0.95 + 0.05 * p, desc))
|
| 209 |
|
|
|
|
|
|
|
|
|
|
| 210 |
|
| 211 |
except Exception as e:
|
| 212 |
print(f"Error details: {str(e)}")
|