added util --add-landmarks-debug-images

This commit is contained in:
iperov 2019-02-13 10:17:08 +04:00
parent 06fe1314d8
commit 6e12594af1
3 changed files with 29 additions and 2 deletions

View file

@ -247,7 +247,7 @@ def mirror_landmarks (landmarks, val):
result[:,0] = val - result[:,0] - 1
return result
def draw_landmarks (image, image_landmarks, color):
def draw_landmarks (image, image_landmarks, color=(0,255,0)):
if len(image_landmarks) != 68:
raise Exception('get_image_eye_mask works only with 68 landmarks')
@ -274,7 +274,7 @@ def draw_landmarks (image, image_landmarks, color):
def draw_rect_landmarks (image, rect, image_landmarks, face_size, face_type):
image_utils.draw_rect (image, rect, (255,0,0), 2 )
draw_landmarks(image, image_landmarks, (0,255,0) )
draw_landmarks(image, image_landmarks)
image_to_face_mat = get_transform_mat (image_landmarks, face_size, face_type)
points = transform_points ( [ (0,0), (0,face_size-1), (face_size-1, face_size-1), (face_size-1,0) ], image_to_face_mat, True)