reab5555 commited on
Commit
96198a3
·
verified ·
1 Parent(s): 9991ae3

Update video_processing.py

Browse files
Files changed (1) hide show
  1. video_processing.py +1 -4
video_processing.py CHANGED
@@ -20,9 +20,6 @@ import mediapipe as mp
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)
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.8)
25
-
26
  def extract_frames(video_path, output_folder, desired_fps, progress_callback=None):
27
  os.makedirs(output_folder, exist_ok=True)
28
  clip = VideoFileClip(video_path)
@@ -275,7 +272,7 @@ def process_video(video_path, anomaly_threshold, desired_fps, progress=None):
275
  )
276
 
277
 
278
- def is_frontal_face(landmarks, threshold=50):
279
  nose_tip = landmarks[4]
280
  left_chin = landmarks[234]
281
  right_chin = landmarks[454]
 
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)
22
 
 
 
 
23
  def extract_frames(video_path, output_folder, desired_fps, progress_callback=None):
24
  os.makedirs(output_folder, exist_ok=True)
25
  clip = VideoFileClip(video_path)
 
272
  )
273
 
274
 
275
+ def is_frontal_face(landmarks, threshold=60):
276
  nose_tip = landmarks[4]
277
  left_chin = landmarks[234]
278
  right_chin = landmarks[454]