SPCT: Soft Pattern Coding Transformer for Lightweight Image Super-Resolution
Qian Wang, Ruilong Guo, Yanyu Mao, Yao Tang and Jiulun Fan
pip install -r requirements.txtThe trainset uses the DIV2K (800). In order to effectively improve the training speed, images are cropped to 480 * 480 images by running script extract_subimages.py, and the dataloader will further randomly crop the images to the GT_size required for training. GT_size defaults to 128/192/256 (×2/×3/×4).
python extract_subimages.pyThe input and output paths of cropped pictures can be modify in this script. Default location: ./datasets/DIV2K.
### Train ###
### SPCT ###
python train.py -opt ./options/train/SPCT/train_SPCT_x2.yml --auto_resume # ×2
python train.py -opt ./options/train/SPCT/train_SPCT_x3.yml --auto_resume # ×3
python train.py -opt ./options/train/SPCT/train_SPCT_x4.yml --auto_resume # ×4
python train.py -opt ./options/train/SPCT/train_SPCT_Tiny_x2.yml --auto_resume # ×2
python train.py -opt ./options/train/SPCT/train_SPCT_Tiny_x3.yml --auto_resume # ×3
python train.py -opt ./options/train/SPCT/train_SPCT_Tiny_x4.yml --auto_resume # ×4For more training commands, please check the docs in BasicSR.
### Test ###
### SPCT for Lightweight Image Super-Resolution ###
python basicsr/test.py -opt ./options/test/SPCT/test_SPCT_x2.yml # ×2
python basicsr/test.py -opt ./options/test/SPCT/test_SPCT_x3.yml # ×3
python basicsr/test.py -opt ./options/test/SPCT/test_SPCT_x4.yml # ×4
python basicsr/test.py -opt ./options/test/SPCT/test_SPCT_Tiny_x2.yml # ×2
python basicsr/test.py -opt ./options/test/SPCT/test_SPCT_Tiny_x3.yml # ×3
python basicsr/test.py -opt ./options/test/SPCT/test_SPCT_Tiny_x4.yml # ×4The inference results on benchmark datasets will be available at Google Drive.
If you have any questions, please feel free to contact us [email protected], [email protected] and [email protected].