cszn / BSRGAN

Designing a Practical Degradation Model for Deep Blind Image Super-Resolution (ICCV, 2021) (PyTorch) - We released the training code!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about the utils_blindsr

FengMu1995 opened this issue · comments

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
......

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

thanks