Update face_analysis.py
Browse files- face_analysis.py +10 -7
face_analysis.py
CHANGED
@@ -43,15 +43,18 @@ def organize_faces_by_person(embeddings_by_frame, clusters, aligned_faces_folder
|
|
43 |
|
44 |
|
45 |
def draw_facial_landmarks(image, landmarks):
|
|
|
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=(
|
|
|
50 |
|
51 |
if landmarks:
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
57 |
return image
|
|
|
43 |
|
44 |
|
45 |
def draw_facial_landmarks(image, landmarks):
|
46 |
+
mp_face_mesh = mp.solutions.face_mesh
|
47 |
mp_drawing = mp.solutions.drawing_utils
|
48 |
|
49 |
+
# Adjust these values to make the drawing thinner
|
50 |
+
landmark_drawing_spec = mp_drawing.DrawingSpec(color=(255, 0, 0), thickness=1, circle_radius=1)
|
51 |
+
connection_drawing_spec = mp_drawing.DrawingSpec(color=(255, 0, 0), thickness=1)
|
52 |
|
53 |
if landmarks:
|
54 |
+
mp_drawing.draw_landmarks(
|
55 |
+
image=image,
|
56 |
+
landmark_list=landmarks,
|
57 |
+
connections=mp_face_mesh.FACEMESH_TESSELATION,
|
58 |
+
landmark_drawing_spec=landmark_drawing_spec,
|
59 |
+
connection_drawing_spec=connection_drawing_spec)
|
60 |
return image
|