Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting failures #719

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions basicsr/archs/basicvsrpp_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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_}'
Expand Down
7 changes: 6 additions & 1 deletion basicsr/ops/upfirdn2d/upfirdn2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion basicsr/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/data_preparation/prepare_hifacegan_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)