reab5555 commited on
Commit
7a6fee1
·
verified ·
1 Parent(s): e0033e6

Update face_analysis.py

Browse files
Files changed (1) hide show
  1. face_analysis.py +6 -5
face_analysis.py CHANGED
@@ -43,16 +43,17 @@ def organize_faces_by_person(embeddings_by_frame, clusters, aligned_faces_folder
43
 
44
  def draw_facial_landmarks(image, landmarks):
45
  mp_face_mesh = mp.solutions.face_mesh
46
- face_mesh = mp_face_mesh.FaceMesh(static_image_mode=False, max_num_faces=1, min_detection_confidence=0.6)
47
  mp_drawing = mp.solutions.drawing_utils
48
- mp_face_mesh = mp.solutions.face_mesh
49
- drawing_spec = mp_drawing.DrawingSpec(thickness=0.2, circle_radius=1)
 
 
50
 
51
  if landmarks:
52
  mp_drawing.draw_landmarks(
53
  image=image,
54
  landmark_list=landmarks,
55
  connections=mp_face_mesh.FACEMESH_TESSELATION,
56
- landmark_drawing_spec=drawing_spec,
57
- connection_drawing_spec=drawing_spec)
58
  return image
 
43
 
44
  def draw_facial_landmarks(image, landmarks):
45
  mp_face_mesh = mp.solutions.face_mesh
 
46
  mp_drawing = mp.solutions.drawing_utils
47
+
48
+ # Adjust these values to make the drawing thinner
49
+ landmark_drawing_spec = mp_drawing.DrawingSpec(color=(0, 255, 0, 128), thickness=1, circle_radius=1)
50
+ connection_drawing_spec = mp_drawing.DrawingSpec(color=(0, 255, 0, 128), thickness=1)
51
 
52
  if landmarks:
53
  mp_drawing.draw_landmarks(
54
  image=image,
55
  landmark_list=landmarks,
56
  connections=mp_face_mesh.FACEMESH_TESSELATION,
57
+ landmark_drawing_spec=landmark_drawing_spec,
58
+ connection_drawing_spec=connection_drawing_spec)
59
  return image