|
发表于 2024-7-29 16:37:47
|
显示全部楼层
这个我会,改一下源码就可以了
dfl目录 > _internal > DeepFaceLab 或者 DFL > mainscripts > Extractor.py
修改一下源码,找到下面的代码段:
output_filepath = output_path / f"{filepath.stem}_{face_idx}.jpg"
cv2_imwrite(output_filepath, face_image, [int(cv2.IMWRITE_JPEG_QUALITY), jpeg_quality ] )
改成:
output_filepath = output_path / f"{filepath.stem}_{face_idx}.jpg"
cv2.putText(face_image, filepath.name, (10, 10), cv2.FONT_HERSHEY_COMPLEX, 1.6, color=(255,255,255), thickness=4)
cv2_imwrite(output_filepath, face_image, [int(cv2.IMWRITE_JPEG_QUALITY), jpeg_quality ] )
如果需要把嘴、鼻子、眼睛、眉毛的标注也显示出来(src不要弄,dst可以有),就改成这样:
output_filepath = output_path / f"{filepath.stem}_{face_idx}.jpg"
LandmarksProcessor.draw_landmarks(face_image, face_image_landmarks)
cv2.putText(face_image, filepath.name, (10, 10), cv2.FONT_HERSHEY_COMPLEX, 1.6, color=(255,255,255), thickness=4)
cv2_imwrite(output_filepath, face_image, [int(cv2.IMWRITE_JPEG_QUALITY), jpeg_quality ] )
修改后保存,重新裁脸就可以了 |
|