Skip to content

Commit

Permalink
add clarification of patch_size in main_test_swinir.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JingyunLiang committed Aug 26, 2021
1 parent a4c0694 commit 5bd10ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main_test_swinir.py
Expand Up @@ -17,7 +17,9 @@ def main():
parser.add_argument('--scale', type=int, default=1, help='scale factor: 1, 2, 3, 4, 8') # 1 for dn and jpeg car
parser.add_argument('--noise', type=int, default=15, help='noise level: 15, 25, 50')
parser.add_argument('--jpeg', type=int, default=40, help='scale factor: 10, 20, 30, 40')
parser.add_argument('--patch_size', type=int, default=128, help='patch size used in SwinIR')
parser.add_argument('--training_patch_size', type=int, default=128, help='patch size used in training SwinIR. '
'Just used to differentiate two different settings in Table 2 of the paper. '
'Images are NOT tested patch by patch.')
parser.add_argument('--large_model', action='store_true', help='use large model, only provided for real image sr')
parser.add_argument('--model_path', type=str,
default='model_zoo/swinir/001_classicalSR_DIV2K_s48w8_SwinIR-M_x2.pth')
Expand Down Expand Up @@ -109,7 +111,7 @@ def main():
def define_model(args):
# 001 classical image sr
if args.task == 'classical_sr':
model = net(upscale=args.scale, in_chans=3, img_size=args.patch_size, window_size=8,
model = net(upscale=args.scale, in_chans=3, img_size=args.training_patch_size, window_size=8,
img_range=1., depths=[6, 6, 6, 6, 6, 6], embed_dim=180, num_heads=[6, 6, 6, 6, 6, 6],
mlp_ratio=2, upsampler='pixelshuffle', resi_connection='1conv')
model.load_state_dict(torch.load(args.model_path)['params'], strict=True)
Expand Down

0 comments on commit 5bd10ce

Please sign in to comment.