From 24571b47e2bb43fa59388bda8816dc8e5580cb3c Mon Sep 17 00:00:00 2001 From: harisreedhar Date: Fri, 15 Nov 2024 20:50:42 +0530 Subject: [PATCH] fix warp_face_by_bounding_box dtype error --- facefusion/face_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facefusion/face_helper.py b/facefusion/face_helper.py index bf7ee91c..5c608093 100644 --- a/facefusion/face_helper.py +++ b/facefusion/face_helper.py @@ -90,7 +90,7 @@ def warp_face_by_face_landmark_5(temp_vision_frame : VisionFrame, face_landmark_ def warp_face_by_bounding_box(temp_vision_frame : VisionFrame, bounding_box : BoundingBox, crop_size : Size) -> Tuple[VisionFrame, Matrix]: source_points = numpy.array([ [ bounding_box[0], bounding_box[1] ], [bounding_box[2], bounding_box[1] ], [ bounding_box[0], bounding_box[3] ] ]).astype(numpy.float32) - target_points = numpy.array([ [ 0, 0 ], [ 1, 0 ], [ 0, 1 ] ]).astype(numpy.float32) * crop_size + target_points = numpy.array([ [ 0, 0 ], [ crop_size[0], 0 ], [ 0, crop_size[1] ] ]).astype(numpy.float32) affine_matrix = cv2.getAffineTransform(source_points, target_points) if bounding_box[2] - bounding_box[0] > crop_size[0] or bounding_box[3] - bounding_box[1] > crop_size[1]: interpolation_method = cv2.INTER_AREA