Spaces:
Runtime error
Runtime error
Update video_processing.py
Browse files- video_processing.py +2 -2
video_processing.py
CHANGED
|
@@ -21,7 +21,7 @@ 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)
|
| 22 |
|
| 23 |
mp_face_mesh = mp.solutions.face_mesh
|
| 24 |
-
face_mesh = mp_face_mesh.FaceMesh(static_image_mode=False, max_num_faces=1, min_detection_confidence=0.
|
| 25 |
|
| 26 |
mp_pose = mp.solutions.pose
|
| 27 |
pose = mp_pose.Pose(static_image_mode=False, min_detection_confidence=0.6, min_tracking_confidence=0.6)
|
|
@@ -251,7 +251,7 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
|
|
| 251 |
frames_folder
|
| 252 |
)
|
| 253 |
|
| 254 |
-
def is_frontal_face(landmarks, threshold=
|
| 255 |
nose_tip = landmarks[4]
|
| 256 |
left_chin = landmarks[234]
|
| 257 |
right_chin = landmarks[454]
|
|
|
|
| 21 |
mtcnn = MTCNN(keep_all=False, device=device, thresholds=[0.9, 0.9, 0.9], min_face_size=50)
|
| 22 |
|
| 23 |
mp_face_mesh = mp.solutions.face_mesh
|
| 24 |
+
face_mesh = mp_face_mesh.FaceMesh(static_image_mode=False, max_num_faces=1, min_detection_confidence=0.6)
|
| 25 |
|
| 26 |
mp_pose = mp.solutions.pose
|
| 27 |
pose = mp_pose.Pose(static_image_mode=False, min_detection_confidence=0.6, min_tracking_confidence=0.6)
|
|
|
|
| 251 |
frames_folder
|
| 252 |
)
|
| 253 |
|
| 254 |
+
def is_frontal_face(landmarks, threshold=50):
|
| 255 |
nose_tip = landmarks[4]
|
| 256 |
left_chin = landmarks[234]
|
| 257 |
right_chin = landmarks[454]
|