Awesome
RankSRGAN
Paper | Supplementary file | Project Page
RankSRGAN: Generative Adversarial Networks with Ranker for Image Super-Resolution
By Wenlong Zhang, Yihao Liu, Chao Dong, Yu Qiao
<p align="center"> <img height="330" src="./figures/method.png"> </p> <p align="center"> <img height="240" src="./figures/visual_results1.png"> </p>
Dependencies
- Python 3 (Recommend to use Anaconda)
- PyTorch >= 1.0.0
- NVIDIA GPU + CUDA
- Python packages:
pip install numpy opencv-python lmdb
- [option] Python packages:
pip install tensorboardX
, for visualizing curves.
Codes
- We update the codes version based on mmsr. The old version can be downloaded from Google Drive
- This version is under testing. We will provide more details of RankSRGAN in near future.
How to Test
- Clone this github repo.
git clone https://github.com/WenlongZhang0724/RankSRGAN.git
cd RankSRGAN
- Place your own low-resolution images in
./LR
folder. - Download pretrained models from Google Drive. Place the models in
./experiments/pretrained_models/
. We provide three Ranker models and three RankSRGAN models (see model list). - Run test. We provide RankSRGAN (NIQE, Ma, PI) model and you can config in the
test.py
.
python test.py -opt options/test/test_RankSRGAN.yml
- The results are in
./results
folder.
How to Train
Train Ranker
- Download DIV2K and Flickr2K from Google Drive or Baidu Drive
- Generate rank dataset ./datasets/generate_rankdataset/
- Run command:
python train_rank.py -opt options/train/train_Ranker.yml
Train RankSRGAN
We use a PSNR-oriented pretrained SR model to initialize the parameters for better quality.
- Prepare datasets, usually the DIV2K dataset.
- Prerapre the PSNR-oriented pretrained model. You can use the
mmsr_SRResNet_pretrain.pth
as the pretrained model that can be downloaded from Google Drive. - Modify the configuration file
options/train/train_RankSRGAN.json
- Run command:
python train.py -opt options/train/train_RankSRGAN.yml
or
python train_niqe.py -opt options/train/train_RankSRGAN.yml
Using the train.py can output the convergence curves with PSNR; Using the train_niqe.py can output the convergence curves with NIQE and PSNR.