diff --git a/basicsr/archs/basicvsrpp_arch.py b/basicsr/archs/basicvsrpp_arch.py index 2a9952e4b..d04a14e68 100644 --- a/basicsr/archs/basicvsrpp_arch.py +++ b/basicsr/archs/basicvsrpp_arch.py @@ -160,7 +160,7 @@ def propagate(self, feats, flows, module_name): feats dict(list[tensor]): Features from previous branches. Each component is a list of tensors with shape (n, c, h, w). flows (tensor): Optical flows with shape (n, t - 1, 2, h, w). - module_name (str): The name of the propgation branches. Can either + module_name (str): The name of the propagation branches. Can either be 'backward_1', 'forward_1', 'backward_2', 'forward_2'. Return: @@ -322,7 +322,7 @@ def forward(self, lqs): f'but got {h} and {w}.') flows_forward, flows_backward = self.compute_flow(lqs_downsample) - # feature propgation + # feature propagation for iter_ in [1, 2]: for direction in ['backward', 'forward']: module = f'{direction}_{iter_}' diff --git a/basicsr/ops/upfirdn2d/upfirdn2d.py b/basicsr/ops/upfirdn2d/upfirdn2d.py index d6122d59a..ed153e478 100644 --- a/basicsr/ops/upfirdn2d/upfirdn2d.py +++ b/basicsr/ops/upfirdn2d/upfirdn2d.py @@ -171,7 +171,12 @@ def upfirdn2d_native(input, kernel, up_x, up_y, down_x, down_y, pad_x0, pad_x1, out = out.view(-1, in_h * up_y, in_w * up_x, minor) out = F.pad(out, [0, 0, max(pad_x0, 0), max(pad_x1, 0), max(pad_y0, 0), max(pad_y1, 0)]) - out = out[:, max(-pad_y0, 0):out.shape[1] - max(-pad_y1, 0), max(-pad_x0, 0):out.shape[2] - max(-pad_x1, 0), :, ] + out = out[ + :, + max(-pad_y0, 0):out.shape[1] - max(-pad_y1, 0), + max(-pad_x0, 0):out.shape[2] - max(-pad_x1, 0), + :, + ] out = out.permute(0, 3, 1, 2) out = out.reshape([-1, 1, in_h * up_y + pad_y0 + pad_y1, in_w * up_x + pad_x0 + pad_x1]) diff --git a/basicsr/test.py b/basicsr/test.py index 53cb3b7aa..5107385f3 100644 --- a/basicsr/test.py +++ b/basicsr/test.py @@ -9,7 +9,7 @@ def test_pipeline(root_path): - # parse options, set distributed setting, set ramdom seed + # parse options, set distributed setting, set random seed opt, _ = parse_options(root_path, is_train=False) torch.backends.cudnn.benchmark = True diff --git a/scripts/data_preparation/prepare_hifacegan_dataset.py b/scripts/data_preparation/prepare_hifacegan_dataset.py index cab2afad5..e2d9c556f 100644 --- a/scripts/data_preparation/prepare_hifacegan_dataset.py +++ b/scripts/data_preparation/prepare_hifacegan_dataset.py @@ -107,7 +107,7 @@ def create_training_dataset(self, deg, gt_folder, lq_folder=None): if __name__ == '__main__': - simuator = DegradationSimulator() + simulator = DegradationSimulator() gt_folder = 'datasets/FFHQ_512_gt' deg = 'sr4x' - simuator.create_training_dataset(deg, gt_folder) + simulator.create_training_dataset(deg, gt_folder)