From 03eb29a4d9b55d05e5e54c0b792aa40f95f33cd4 Mon Sep 17 00:00:00 2001 From: James Betker Date: Tue, 25 Aug 2020 11:57:25 -0600 Subject: [PATCH] Fix LQGT dataset --- codes/data/LQGT_dataset.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codes/data/LQGT_dataset.py b/codes/data/LQGT_dataset.py index 55f8dd06..587456a6 100644 --- a/codes/data/LQGT_dataset.py +++ b/codes/data/LQGT_dataset.py @@ -135,12 +135,12 @@ class LQGTDataset(data.Dataset): # Enforce force_resize constraints. h, w, _ = img_LQ.shape if h % self.force_multiple != 0 or w % self.force_multiple != 0: - h, w = (w - w % self.force_multiple), (h - h % self.force_multiple) - img_LQ = cv2.resize(img_LQ, (h, w)) + h, w = (h - h % self.force_multiple), (w - w % self.force_multiple) + img_LQ = img_LQ[:h, :w, :] h *= scale w *= scale - img_GT = cv2.resize(img_GT, (h, w)) - img_PIX = cv2.resize(img_LQ, (h, w)) + img_GT = img_GT[:h, :w, :] + img_PIX = img_PIX[:h, :w, :] if self.opt['phase'] == 'train': H, W, _ = img_GT.shape