Skip to content

Commit 00cd826

Browse files
committed
Merge pull request matthewearl#6 from svezina/master
Fix "Cannot cast ufunc add output" error
2 parents b7dbd69 + 7ba6b03 commit 00cd826

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

faceswap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def correct_colours(im1, im2, landmarks1):
194194
im2_blur = cv2.GaussianBlur(im2, (blur_amount, blur_amount), 0)
195195

196196
# Avoid divide-by-zero errors.
197-
im2_blur += 128 * (im2_blur <= 1.0)
197+
im2_blur += (128 * (im2_blur <= 1.0)).astype(im2_blur.dtype)
198198

199199
return (im2.astype(numpy.float64) * im1_blur.astype(numpy.float64) /
200200
im2_blur.astype(numpy.float64))

0 commit comments

Comments
 (0)