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) ) 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) image_utils.draw_polygon (image, points, (0,0,255), 2)
def draw_rect_landmarks (image, rect, image_landmarks, face_size, face_type, transparent_mask=False): image = draw_landmarks(image, image_landmarks, transparent_mask=transparent_mask) image_utils.draw_rect (image, rect, (255,0,0), 2 ) 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) image_utils.draw_polygon (image, points, (0,0,255), 2) return image