From 90073fc76180eef6e2a76a711c3ccde1cc0858d0 Mon Sep 17 00:00:00 2001 From: James Betker Date: Sat, 23 May 2020 21:05:49 -0600 Subject: [PATCH] Update LQ_dataset to support inference on split image videos --- codes/data/LQ_dataset.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/codes/data/LQ_dataset.py b/codes/data/LQ_dataset.py index 29555dee..54bc379f 100644 --- a/codes/data/LQ_dataset.py +++ b/codes/data/LQ_dataset.py @@ -33,14 +33,15 @@ class LQDataset(data.Dataset): def __getitem__(self, index): if self.data_type == 'lmdb' and self.LQ_env is None: self._init_lmdb() - actual_index = int(index / 2) + actual_index = index # int(index / 2) is_left = (index % 2) == 0 # get LQ image LQ_path = self.paths_LQ[actual_index] img_LQ = Image.open(LQ_path) - left = 0 if is_left else 2000 - img_LQ = F.crop(img_LQ, 74, left + 74, 1900, 1900) + left = 0 if is_left else 1920 + # crop input if needed. + #img_LQ = F.crop(img_LQ, 5, left + 5, 1900, 1900) img_LQ = F.to_tensor(img_LQ) img_name = osp.splitext(osp.basename(LQ_path))[0] @@ -49,4 +50,4 @@ class LQDataset(data.Dataset): return {'LQ': img_LQ, 'LQ_path': LQ_path} def __len__(self): - return len(self.paths_LQ) * 2 + return len(self.paths_LQ) # * 2