From 8464cae1683eb82322473fc377e29ecd9e9b3b17 Mon Sep 17 00:00:00 2001 From: James Betker Date: Sun, 24 May 2020 22:32:54 -0600 Subject: [PATCH] HQ blurring doesnt actually work right - hq images arent the right size when they are blurred Just revert it and blur the lq images.. --- codes/data/LQGT_dataset.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/codes/data/LQGT_dataset.py b/codes/data/LQGT_dataset.py index 2eea89d5..02583f92 100644 --- a/codes/data/LQGT_dataset.py +++ b/codes/data/LQGT_dataset.py @@ -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)