Spaces:
Runtime error
Runtime error
Update video_processing.py
Browse files- video_processing.py +2 -8
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 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
|
13 |
-
from utils import frame_to_timecode
|
14 |
import pandas as pd
|
15 |
from facenet_pytorch import MTCNN
|
16 |
import torch
|
@@ -224,11 +224,6 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
224 |
frame_img_with_timecode = add_timecode_to_image(frame_img, timecode)
|
225 |
anomaly_frames_posture_images.append(frame_img_with_timecode)
|
226 |
|
227 |
-
# Create annotated video
|
228 |
-
annotated_video_path = os.path.join(output_folder, "annotated_video.mp4")
|
229 |
-
create_annotated_video(video_path, df, mse_embeddings, largest_cluster, annotated_video_path)
|
230 |
-
|
231 |
-
|
232 |
return (
|
233 |
execution_time,
|
234 |
results,
|
@@ -246,8 +241,7 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
246 |
anomaly_faces_embeddings,
|
247 |
anomaly_frames_posture_images,
|
248 |
aligned_faces_folder,
|
249 |
-
frames_folder
|
250 |
-
annotated_video_path
|
251 |
)
|
252 |
|
253 |
def is_frontal_face(landmarks, threshold=50):
|
|
|
10 |
from pose_analysis import 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
|
13 |
+
from utils import frame_to_timecode
|
14 |
import pandas as pd
|
15 |
from facenet_pytorch import MTCNN
|
16 |
import torch
|
|
|
224 |
frame_img_with_timecode = add_timecode_to_image(frame_img, timecode)
|
225 |
anomaly_frames_posture_images.append(frame_img_with_timecode)
|
226 |
|
|
|
|
|
|
|
|
|
|
|
227 |
return (
|
228 |
execution_time,
|
229 |
results,
|
|
|
241 |
anomaly_faces_embeddings,
|
242 |
anomaly_frames_posture_images,
|
243 |
aligned_faces_folder,
|
244 |
+
frames_folder
|
|
|
245 |
)
|
246 |
|
247 |
def is_frontal_face(landmarks, threshold=50):
|