From 0d1f196a985215e389032899afb0dc72eb50c64d Mon Sep 17 00:00:00 2001 From: liyinshuo Date: Tue, 15 Jun 2021 13:49:47 +0800 Subject: [PATCH] Fix --- mmedit/models/restorers/dic.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mmedit/models/restorers/dic.py b/mmedit/models/restorers/dic.py index 8afc3ef178..3421ec6bd3 100644 --- a/mmedit/models/restorers/dic.py +++ b/mmedit/models/restorers/dic.py @@ -53,8 +53,7 @@ def __init__(self, self.align_loss = build_loss(align_loss) # pretrained - if pretrained: - self.init_weights(pretrained) + self.init_weights(pretrained) def forward(self, lq, gt=None, test_mode=False, **kwargs): """Forward function. @@ -167,10 +166,10 @@ def forward_test(self, # save image if save_image: if 'gt_path' in meta[0]: - the_path = meta[0]['gt_path'] + pred_path = meta[0]['gt_path'] else: - the_path = meta[0]['lq_path'] - folder_name = osp.splitext(osp.basename(the_path))[0] + pred_path = meta[0]['lq_path'] + folder_name = osp.splitext(osp.basename(pred_path))[0] if isinstance(iteration, numbers.Number): save_path = osp.join(save_path, folder_name, f'{folder_name}-{iteration + 1:06d}.png')