This is an official implementation of Unfolding the Alternating Optimization for Blind Super Resolution
This repo is build on the basis of [MMSR] and [IKC]
- python3
- pytorch >= 1.5
- NVIDIA GPU + CUDA
- Python packages: pip3 install numpy opencv-python lmdb pyyaml
The pretrained models and visual results on DIV2KRK are available at BaiduYun(Password: u9ah) GoogleDrive
We use DIV2K and Flickr2K as our training datasets.
For evaluation of Setting 1, we use five datasets, i.e., Set5, Set14, Urban100, BSD100 and Manga109.
We use DIV2KRK for evaluation of Setting 2.
To train a model on the full dataset(DIV2K+Flickr2K, totally 3450 images), download datasets from official websites.
After download, run codes/scripts/generate_mod_blur_LR_bic.py
to generate LRblur/LR/HR/Bicubic datasets paths. (You need to modify the file paths by yourself.)
python3 codes/scripts/generate_mod_blur_LR_bic.py
For efficient IO, run codes/scripts/create_lmdb.py
to transform datasets to binary files. (You need to modify the file paths by yourself.)
python3 codes/scripts/create_lmdb.py
For single GPU:
cd codes/config/DAN
python3 train.py -opt=train_setting1.yml
For distributed training
cd codes/config/DAN
bash run_scripts.sh
cd codes/config/DAN
python3 test.py -opt=test_setting1.yml
cd codes/config/DAN
python3 test_single_image.py -opt=test_option.yml -input_dir=/path/to/real/images/ -output_dir=/path/to/save/sr/results/