mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-11 15:47:01 -07:00
added util --add-landmarks-debug-images
This commit is contained in:
parent
06fe1314d8
commit
6e12594af1
3 changed files with 29 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue