diff --git a/data/realsr_preprocess/imresize.py b/data/realsr_preprocess/imresize.py index 02fa92a19a7a4013381f7baf7ab1470100876e8c..6d61bc7caa2618d8617f3c5c9128f577c29cec53 100644 --- a/data/realsr_preprocess/imresize.py +++ b/data/realsr_preprocess/imresize.py @@ -218,7 +218,7 @@ def kernel_shift(kernel, sf): # Before applying the shift, we first pad the kernel so that nothing is lost due to the shift # (biggest shift among dims + 1 for safety) - kernel = np.pad(kernel, np.int(np.ceil(np.max(shift_vec))) + 1, 'constant') + kernel = np.pad(kernel, np.int_(np.ceil(np.max(shift_vec))) + 1, 'constant') # Finally shift the kernel and return return interpolation.shift(kernel, shift_vec) diff --git a/ppgan/faceutils/face_detection/utils.py b/ppgan/faceutils/face_detection/utils.py index 6590f9662252d26dd67c4adc2e82b3b86a8123a1..570b2c259222ffde1876b3f459b29bed8f3653e0 100644 --- a/ppgan/faceutils/face_detection/utils.py +++ b/ppgan/faceutils/face_detection/utils.py @@ -59,7 +59,7 @@ def crop(image, center, scale, resolution=256.0): dtype=np.int32) newImg = np.zeros(newDim, dtype=np.uint8) else: - newDim = np.array([br[1] - ul[1], br[0] - ul[0]], dtype=np.int) + newDim = np.array([br[1] - ul[1], br[0] - ul[0]], dtype=np.int_) newImg = np.zeros(newDim, dtype=np.uint8) ht = image.shape[0] wd = image.shape[1] diff --git a/ppgan/models/generators/generator_starganv2.py b/ppgan/models/generators/generator_starganv2.py index e5bbce0f980df64699b426503b9940edf35ede15..636df792e23970229453ab161ce98261bc398ae1 100755 --- a/ppgan/models/generators/generator_starganv2.py +++ b/ppgan/models/generators/generator_starganv2.py @@ -240,8 +240,8 @@ class StarGANv2Mapping(nn.Layer): s = [] for i in range(idx.shape[0]): s += [ - out[idx[i].numpy().astype(np.int).tolist()[0], - y[i].numpy().astype(np.int).tolist()[0]] + out[idx[i].numpy().astype(np.int_).tolist()[0], + y[i].numpy().astype(np.int_).tolist()[0]] ] s = paddle.stack(s) s = paddle.reshape(s, (s.shape[0], -1)) @@ -286,8 +286,8 @@ class StarGANv2Style(nn.Layer): s = [] for i in range(idx.shape[0]): s += [ - out[idx[i].numpy().astype(np.int).tolist()[0], - y[i].numpy().astype(np.int).tolist()[0]] + out[idx[i].numpy().astype(np.int_).tolist()[0], + y[i].numpy().astype(np.int_).tolist()[0]] ] s = paddle.stack(s) s = paddle.reshape(s, (s.shape[0], -1)) diff --git a/requirements.txt b/requirements.txt index 8b072c66e7e2d8c2957a823680e55b7838bebbf2..6eeab8951a910d8d10c573f55d0619db78394519 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,11 +2,11 @@ tqdm PyYAML>=5.1 scikit-image>=0.14.0 scipy>=1.1.0 -opencv-python <= 4.6.0 +opencv-python==4.6.0.66 imageio==2.9.0 imageio-ffmpeg librosa==0.8.1 -numba==0.53.1 +numba easydict munch natsort