From d152e1519b68f68f215410e81e551e93f7e348ee Mon Sep 17 00:00:00 2001 From: Jiamin Date: Mon, 27 Jul 2020 01:12:36 +0800 Subject: [PATCH] fix: normalize redundant loop (#121) --- mmedit/datasets/pipelines/normalization.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mmedit/datasets/pipelines/normalization.py b/mmedit/datasets/pipelines/normalization.py index 35c231147f..292d02d8ce 100644 --- a/mmedit/datasets/pipelines/normalization.py +++ b/mmedit/datasets/pipelines/normalization.py @@ -37,11 +37,10 @@ def __call__(self, results): """ for key in self.keys: if isinstance(results[key], list): - for v in results[key]: - results[key] = [ - mmcv.imnormalize(v, self.mean, self.std, self.to_rgb) - for v in results[key] - ] + results[key] = [ + mmcv.imnormalize(v, self.mean, self.std, self.to_rgb) + for v in results[key] + ] else: results[key] = mmcv.imnormalize(results[key], self.mean, self.std, self.to_rgb)