Skip to content

DYDevelop/Image-Restortion-SwinIR

Repository files navigation

Training and testing codes for SwinIR


  • TestSet(Left) and Transfer Leraning on Iter 95000 (Right)

Clone repo

https://github.com/DYDevelop/SwinIR.git
pip install -r requirement.txt

Training

You should modify the json file from options first, for example, setting "gpu_ids": [0,1,2,3] if 4 GPUs are used, setting "dataroot_H": "trainsets/trainH" if path of the high quality dataset is trainsets/trainH.

  • Training with DataParallel - SwinIR
python main_train_psnr.py --opt options/swinir/train_swinir_denoising_color.json

Inference

  • Inference on DataParallel - SwinIR
python main_test_swinir.py --task color_dn --noise 0 --model_path denoising/swinir_denoising_color_15/models/100000_G.pth --folder_gt testsets/custom_dataset

References

@inproceedings{liang2021swinir,
title={SwinIR: Image Restoration Using Swin Transformer},
author={Liang, Jingyun and Cao, Jiezhang and Sun, Guolei and Zhang, Kai and Van Gool, Luc and Timofte, Radu},
booktitle={IEEE International Conference on Computer Vision Workshops},
pages={1833--1844},
year={2021}
}

Credits

Our Swin Image Reconstruction implementation is heavily based on Kai Zhang's KAIR.