Open robtow opened 7 months ago
I have Windows 10 and I was receiving problems as well with this module. I had to make more changes to make it work. This function is mixing datatypes so I had to make all arrays of type numpy float64 to make it consistent.
Starting with the function at line 217: def blur_blending_cv2(im1, im2, mask):
mask = mask.astype(np.float64) <===include this line
mask /= 255. <===include this line
#mask *= 255. <===comment out
kernel = np.ones((9, 9), np.float64) #np.uint8) <===modify this line
mask = cv2.erode(mask, kernel, iterations=3)
mask_blur = cv2.GaussianBlur(mask, (25, 25), 0)
mask_blur /= 255.
im2 = im2.astype(np.float64) <===include this line
im = im1 * mask_blur + (1. - mask_blur) * im2
im /= 255.0
im = np.clip(im, 0.0, 1.0)
return im
Starting with line 433 I had to modify to: blended = blur_blending_cv2(warped_back, blended, backward_mask)
io.imsave(os.path.join(save_url, x), img_as_ubyte(blended)) # (blended / 255.0)) <=== modify
Fresh install of the repo, and using a venv with Python 3.10.12:
Fix at line 219 in align_warp_back_multiple_dlib.py