Update visualization.py
Browse files- visualization.py +14 -0
visualization.py
CHANGED
@@ -199,3 +199,17 @@ def plot_posture(df, posture_scores, color='blue', anomaly_threshold=3):
|
|
199 |
plt.tight_layout()
|
200 |
plt.close()
|
201 |
return fig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
plt.tight_layout()
|
200 |
plt.close()
|
201 |
return fig
|
202 |
+
|
203 |
+
def draw_facial_landmarks(image, landmarks):
|
204 |
+
mp_drawing = mp.solutions.drawing_utils
|
205 |
+
mp_face_mesh = mp.solutions.face_mesh
|
206 |
+
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radius=1)
|
207 |
+
|
208 |
+
if landmarks:
|
209 |
+
mp_drawing.draw_landmarks(
|
210 |
+
image=image,
|
211 |
+
landmark_list=landmarks,
|
212 |
+
connections=mp_face_mesh.FACEMESH_TESSELATION,
|
213 |
+
landmark_drawing_spec=drawing_spec,
|
214 |
+
connection_drawing_spec=drawing_spec)
|
215 |
+
return image
|