|
发表于 2023-3-2 13:09:54
|
显示全部楼层
是这句不
img_name = img_name.replace("png", "jpg").replace("PNG", "jpg") # 后缀变动
i = 0
for face in faces:
image_size = 512
landmark = self.landmark106to68(face.landmark_2d_106)
image_to_face_mat = get_transform_mat(landmark, image_size, face_style)#脸型
face_image = cv2.warpAffine(img_mat, image_to_face_mat, (image_size, image_size), cv2.INTER_LANCZOS4)
face_image_landmarks = transform_points(landmark, image_to_face_mat)
landmarks_bbox = transform_points(
[(0, 0), (0, image_size - 1), (image_size - 1, image_size - 1), (image_size - 1, 0)],
image_to_face_mat, True) |
|