Spaces:
Runtime error
Runtime error
Update video_processing.py
Browse files- video_processing.py +1 -3
video_processing.py
CHANGED
|
@@ -16,7 +16,6 @@ import pandas as pd
|
|
| 16 |
from facenet_pytorch import MTCNN
|
| 17 |
import torch
|
| 18 |
import mediapipe as mp
|
| 19 |
-
from pyannote.audio import Model
|
| 20 |
|
| 21 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 22 |
mtcnn = MTCNN(keep_all=False, device=device, thresholds=[0.9, 0.9, 0.9], min_face_size=50)
|
|
@@ -90,8 +89,6 @@ def process_frames(frames_folder, aligned_faces_folder, frame_count, progress):
|
|
| 90 |
|
| 91 |
return embeddings_by_frame, posture_scores_by_frame, posture_landmarks_by_frame, aligned_face_paths, facial_landmarks_by_frame
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
| 96 |
start_time = time.time()
|
| 97 |
output_folder = "output"
|
|
@@ -316,6 +313,7 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
| 316 |
scatter_plot_3d
|
| 317 |
)
|
| 318 |
|
|
|
|
| 319 |
def is_frontal_face(landmarks, threshold=60):
|
| 320 |
nose_tip = landmarks[4]
|
| 321 |
left_chin = landmarks[234]
|
|
|
|
| 16 |
from facenet_pytorch import MTCNN
|
| 17 |
import torch
|
| 18 |
import mediapipe as mp
|
|
|
|
| 19 |
|
| 20 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 21 |
mtcnn = MTCNN(keep_all=False, device=device, thresholds=[0.9, 0.9, 0.9], min_face_size=50)
|
|
|
|
| 89 |
|
| 90 |
return embeddings_by_frame, posture_scores_by_frame, posture_landmarks_by_frame, aligned_face_paths, facial_landmarks_by_frame
|
| 91 |
|
|
|
|
|
|
|
| 92 |
def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
| 93 |
start_time = time.time()
|
| 94 |
output_folder = "output"
|
|
|
|
| 313 |
scatter_plot_3d
|
| 314 |
)
|
| 315 |
|
| 316 |
+
|
| 317 |
def is_frontal_face(landmarks, threshold=60):
|
| 318 |
nose_tip = landmarks[4]
|
| 319 |
left_chin = landmarks[234]
|