Spaces:
Runtime error
Runtime error
Update video_processing.py
Browse files- video_processing.py +5 -1
video_processing.py
CHANGED
|
@@ -182,9 +182,13 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
| 182 |
|
| 183 |
progress(0.9, "Generating video with heatmap")
|
| 184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
# Create video with heatmap
|
| 186 |
heatmap_video_path = os.path.join(output_folder, "video_with_heatmap.mp4")
|
| 187 |
-
create_video_with_heatmap(video_path,
|
| 188 |
|
| 189 |
|
| 190 |
except Exception as e:
|
|
|
|
| 182 |
|
| 183 |
progress(0.9, "Generating video with heatmap")
|
| 184 |
|
| 185 |
+
# Convert heatmaps to images
|
| 186 |
+
mse_heatmap_embeddings_img = fig_to_img(mse_heatmap_embeddings)
|
| 187 |
+
mse_heatmap_posture_img = fig_to_img(mse_heatmap_posture)
|
| 188 |
+
|
| 189 |
# Create video with heatmap
|
| 190 |
heatmap_video_path = os.path.join(output_folder, "video_with_heatmap.mp4")
|
| 191 |
+
create_video_with_heatmap(video_path, mse_heatmap_embeddings_img, mse_heatmap_posture_img, heatmap_video_path, desired_fps)
|
| 192 |
|
| 193 |
|
| 194 |
except Exception as e:
|