HQ blurring doesnt actually work right - hq images arent the right size when they are blurred

Just revert it and blur the lq images..
This commit is contained in:
James Betker 2020-05-24 22:32:54 -06:00
parent 5fd8749cf2
commit 8464cae168

View File

@ -90,7 +90,6 @@ class LQGTDataset(data.Dataset):
img_PIX = img_GT
# get LQ image
already_blurred = False
if self.paths_LQ:
LQ_path = self.get_lq_path(index)
resolution = [int(s) for s in self.sizes_LQ[index].split('_')
@ -115,15 +114,8 @@ class LQGTDataset(data.Dataset):
H, W, _ = img_GT.shape
if self.opt['use_blurring']:
blur_sig = int(random.randrange(0, 8))
hqxform = cv2.GaussianBlur(img_GT, (5, 5), blur_sig)
already_blurred = True
else:
hqxform = img_GT
# using matlab imresize
img_LQ = util.imresize_np(hqxform, 1 / scale, True)
img_LQ = util.imresize_np(img_GT, 1 / scale, True)
if img_LQ.ndim == 2:
img_LQ = np.expand_dims(img_LQ, axis=2)
@ -151,7 +143,7 @@ class LQGTDataset(data.Dataset):
img_LQ, img_GT, img_PIX = util.augment([img_LQ, img_GT, img_PIX], self.opt['use_flip'],
self.opt['use_rot'])
if self.opt['use_blurring'] and not already_blurred:
if self.opt['use_blurring']:
blur_sig = int(random.randrange(0, 4))
img_LQ = cv2.GaussianBlur(img_LQ, (3, 3), blur_sig)