reab5555 commited on
Commit
07b109b
·
verified ·
1 Parent(s): 9306d44

Update video_processing.py

Browse files
Files changed (1) hide show
  1. 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, mse_heatmap_embeddings, mse_heatmap_posture, heatmap_video_path, desired_fps)
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: