(CVPR2021) ClassSR: A General Framework to Accelerate Super-Resolution Networks by Data Characteristic
Authors: Xiangtao Kong, Hengyuan Zhao, Yu Qiao, Chao Dong
- Python >= 3.6 (Recommend to use Anaconda)
- PyTorch >= 1.5.0
- NVIDIA GPU + CUDA
- Python packages:
pip install numpy opencv-python lmdb
- [option] Python packages:
pip install tensorboardX
, for visualizing curves.
- Our codes version based on BasicSR.
- Clone this github repo.
git clone https://github.com/Xiangtaokong/ClassSR.git
cd ClassSR
-
Download the testing datasets (DIV2K_valid).
-
Download the divide_val.log and move it to
.codes/data_scripts/
. -
Generate simple, medium, hard (class1, class2, class3) validation data.
cd codes/data_scripts
python extract_subimages_test.py
python divide_subimages_test.py
-
Download pretrained models and move them to
./experiments/pretrained_models/
folder. -
Run testing for a single branch.
cd codes
python test.py -opt options/test/test_FSRCNN.yml
python test.py -opt options/test/test_CARN.yml
python test.py -opt options/test/test_SRResNet.yml
python test.py -opt options/test/test_RCAN.yml
- The output results will be sorted in
./results
.
- Clone this github repo.
git clone https://github.com/Xiangtaokong/ClassSR.git
cd ClassSR
-
Download the testing datasets (DIV8K). Test8K contains the images (index 1401-1500) from DIV8K. Test2K/4K contain the images (index 1201-1300/1301-1400) from DIV8K which are downsampled to 2K and 4K resolution.
-
Download pretrained models and move them to
./experiments/pretrained_models/
folder. -
Run testing for ClassSR.
cd codes
python test_ClassSR.py -opt options/test/test_ClassSR_FSRCNN.yml
python test_ClassSR.py -opt options/test/test_ClassSR_CARN.yml
python test_ClassSR.py -opt options/test/test_ClassSR_SRResNet.yml
python test_ClassSR.py -opt options/test/test_ClassSR_RCAN.yml
- The output results will be sorted in
./results
.
- Clone this github repo.
git clone https://github.com/Xiangtaokong/ClassSR.git
cd ClassSR
-
Download the training datasets(DIV2K) and validation dataset(Set5).
-
Download the divide_train.log and move it to
.codes/data_scripts/
. -
Generate simple, medium, hard (class1, class2, class3) training data.
cd codes/data_scripts
python data_augmentation.py
python generate_mod_LR_bic.py
python extract_subimages_train.py
python divide_subimages_train.py
- Run training for a single branch (default branch1, the simplest branch).
cd codes
python train.py -opt options/train/train_FSRCNN.yml
python train.py -opt options/train/train_CARN.yml
python train.py -opt options/train/train_SRResNet.yml
python train.py -opt options/train/train_RCAN.yml
- The experiments will be sorted in
./experiments
.
- Clone this github repo.
git clone https://github.com/Xiangtaokong/ClassSR.git
cd ClassSR
-
Download the training datasets (DIV2K) and validation dataset(DIV2K_valid, index 801-810).
-
Generate training data (the all data(1.59M) in paper).
cd codes/data_scripts
python data_augmentation.py
python generate_mod_LR_bic.py
python extract_subimages_train.py
-
Download pretrained models(pretrained branches) and move them to
./experiments/pretrained_models/
folder. -
Run training for ClassSR.
cd codes
python train_ClassSR.py -opt options/train/train_ClassSR_FSRCNN.yml
python train_ClassSR.py -opt options/train/train_ClassSR_CARN.yml
python train_ClassSR.py -opt options/train/train_ClassSR_SRResNet.yml
python train_ClassSR.py -opt options/train/train_ClassSR_RCAN.yml
- The experiments will be sorted in
./experiments
.
Email: xt.kong@siat.ac.cn