Spaces:
Runtime error
Runtime error
Update video_processing.py
Browse files- video_processing.py +2 -6
video_processing.py
CHANGED
|
@@ -10,7 +10,7 @@ from face_analysis import get_face_embedding, cluster_faces, organize_faces_by_p
|
|
| 10 |
from pose_analysis import pose, calculate_posture_score, draw_pose_landmarks
|
| 11 |
from voice_analysis import get_speaker_embeddings, align_voice_embeddings, extract_audio_from_video, diarize_speakers
|
| 12 |
from anomaly_detection import anomaly_detection
|
| 13 |
-
from visualization import plot_mse, plot_mse_histogram, plot_mse_heatmap, create_video_with_heatmap,
|
| 14 |
from utils import frame_to_timecode
|
| 15 |
import pandas as pd
|
| 16 |
from facenet_pytorch import MTCNN
|
|
@@ -197,9 +197,6 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
| 197 |
mse_heatmap_posture = plot_mse_heatmap(mse_posture, "Body Posture MSE Heatmap", df)
|
| 198 |
mse_heatmap_voice = plot_mse_heatmap(mse_voice, "Voice MSE Heatmap", df)
|
| 199 |
|
| 200 |
-
# Generate the combined MSE plot
|
| 201 |
-
combined_mse_plot = plot_combined_mse(df, mse_embeddings, mse_posture, mse_voice, "Combined MSE Plot")
|
| 202 |
-
|
| 203 |
correlation_heatmap = plot_correlation_heatmap(mse_embeddings, mse_posture, mse_voice)
|
| 204 |
|
| 205 |
try:
|
|
@@ -229,7 +226,7 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
| 229 |
print(f"Error details: {str(e)}")
|
| 230 |
import traceback
|
| 231 |
traceback.print_exc()
|
| 232 |
-
return (f"Error in video processing: {str(e)}",) + (None,) *
|
| 233 |
|
| 234 |
progress(1.0, "Preparing results")
|
| 235 |
results = f"Number of persons detected: {num_clusters}\n\n"
|
|
@@ -297,7 +294,6 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
| 297 |
aligned_faces_folder,
|
| 298 |
frames_folder,
|
| 299 |
heatmap_video_path,
|
| 300 |
-
combined_mse_plot,
|
| 301 |
correlation_heatmap
|
| 302 |
)
|
| 303 |
|
|
|
|
| 10 |
from pose_analysis import pose, calculate_posture_score, draw_pose_landmarks
|
| 11 |
from voice_analysis import get_speaker_embeddings, align_voice_embeddings, extract_audio_from_video, diarize_speakers
|
| 12 |
from anomaly_detection import anomaly_detection
|
| 13 |
+
from visualization import plot_mse, plot_mse_histogram, plot_mse_heatmap, create_video_with_heatmap, plot_correlation_heatmap
|
| 14 |
from utils import frame_to_timecode
|
| 15 |
import pandas as pd
|
| 16 |
from facenet_pytorch import MTCNN
|
|
|
|
| 197 |
mse_heatmap_posture = plot_mse_heatmap(mse_posture, "Body Posture MSE Heatmap", df)
|
| 198 |
mse_heatmap_voice = plot_mse_heatmap(mse_voice, "Voice MSE Heatmap", df)
|
| 199 |
|
|
|
|
|
|
|
|
|
|
| 200 |
correlation_heatmap = plot_correlation_heatmap(mse_embeddings, mse_posture, mse_voice)
|
| 201 |
|
| 202 |
try:
|
|
|
|
| 226 |
print(f"Error details: {str(e)}")
|
| 227 |
import traceback
|
| 228 |
traceback.print_exc()
|
| 229 |
+
return (f"Error in video processing: {str(e)}",) + (None,) * 26
|
| 230 |
|
| 231 |
progress(1.0, "Preparing results")
|
| 232 |
results = f"Number of persons detected: {num_clusters}\n\n"
|
|
|
|
| 294 |
aligned_faces_folder,
|
| 295 |
frames_folder,
|
| 296 |
heatmap_video_path,
|
|
|
|
| 297 |
correlation_heatmap
|
| 298 |
)
|
| 299 |
|