reab5555 commited on
Commit
09770fc
·
verified ·
1 Parent(s): 8a3e709

Update video_processing.py

Browse files
Files changed (1) hide show
  1. 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(0.95, "Generating video with heatmap")
 
 
 
 
 
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)}")