From d8889377142e07eff8d1fe091944e7c2180ee930 Mon Sep 17 00:00:00 2001 From: 201910812 <57256215+yoonho0922@users.noreply.github.com> Date: Tue, 21 Jul 2020 15:40:10 +0900 Subject: [PATCH] debug visualize_facial_landmarks function 'jaw' Code 'cv2.line(overlay, ptA, ptB, colors[i], 2)' IndexError: list index out of range because of color[7]. List color have only 7 object --- imutils/face_utils/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imutils/face_utils/helpers.py b/imutils/face_utils/helpers.py index 4889019..baf3953 100644 --- a/imutils/face_utils/helpers.py +++ b/imutils/face_utils/helpers.py @@ -80,7 +80,7 @@ def visualize_facial_landmarks(image, shape, colors=None, alpha=0.75): for l in range(1, len(pts)): ptA = tuple(pts[l - 1]) ptB = tuple(pts[l]) - cv2.line(overlay, ptA, ptB, colors[i], 2) + cv2.line(overlay, ptA, ptB, colors[i-1], 2) # otherwise, compute the convex hull of the facial # landmark coordinates points and display it