reab5555 commited on
Commit
afbf6b6
·
verified ·
1 Parent(s): 367ceb2

Update video_processing.py

Browse files
Files changed (1) hide show
  1. video_processing.py +3 -8
video_processing.py CHANGED
@@ -9,7 +9,7 @@ import math
9
  from face_analysis import get_face_embedding, cluster_faces, organize_faces_by_person, draw_facial_landmarks
10
  from pose_analysis import pose, calculate_posture_score, draw_pose_landmarks
11
  from anomaly_detection import anomaly_detection
12
- from visualization import plot_mse, plot_mse_histogram, plot_mse_heatmap, create_video_with_heatmap, fig_to_img
13
  from utils import frame_to_timecode
14
  import pandas as pd
15
  from facenet_pytorch import MTCNN
@@ -182,14 +182,9 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
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:
195
  print(f"Error details: {str(e)}")
 
9
  from face_analysis import get_face_embedding, cluster_faces, organize_faces_by_person, draw_facial_landmarks
10
  from pose_analysis import pose, calculate_posture_score, draw_pose_landmarks
11
  from anomaly_detection import anomaly_detection
12
+ from visualization import plot_mse, plot_mse_histogram, plot_mse_heatmap, create_video_with_heatmap
13
  from utils import frame_to_timecode
14
  import pandas as pd
15
  from facenet_pytorch import MTCNN
 
182
 
183
  progress(0.9, "Generating video with heatmap")
184
 
 
 
 
 
185
  # Create video with heatmap
186
+ heatmap_video_path = os.path.join(output_folder, "heatmap_video.mp4")
187
+ heatmap_video_path = create_video_with_heatmap(video_path, df, mse_embeddings, mse_posture, heatmap_video_path, desired_fps, largest_cluster)
 
188
 
189
  except Exception as e:
190
  print(f"Error details: {str(e)}")