cszn / BSRGAN

Designing a Practical Degradation Model for Deep Blind Image Super-Resolution (ICCV, 2021) (PyTorch) - We released the training code!
Apache License 2.0
1.19k stars 179 forks source link

Question about the utils_blindsr #31

Closed FengMu1995 closed 2 years ago

FengMu1995 commented 2 years ago

why did you write the "util.imresize_np" function? Is there a difference between cv2.resize and util.imresize_np?

..... if sf == 4 and random.random() < scale2_prob: # downsample1 if np.random.rand() < 0.5: img = cv2.resize(img, (int(1/2img.shape[1]), int(1/2img.shape[0])), interpolation=random.choice([1,2,3])) else: img = util.imresize_np(img, 1/2, True) img = np.clip(img, 0.0, 1.0) sf = 2 ......

cszn commented 2 years ago

util.imresize_np is similar to matlab's bicubic imresize function. It is different from bicubic imresize by cv2.resize.

FengMu1995 commented 2 years ago

thanks