/BasicSR

Basic Super-Resolution codes for development. Includes ESRGAN, SFT-GAN for training and testing.

Primary LanguagePython

🌞 We are updating codes and description these days.

An image super-resolution toolkit flexible for development. It now provides:

  1. PSNR-oriented SR models (e.g., SRCNN, SRResNet and etc). You can try different architectures, e.g, ResNet Block, ResNeXt Block, Dense Block, Residual Dense Block, Poly Block, Dual Path Block, Squeeze-and-Excitation Block, Residual-in-Residual Dense Block and etc.
  1. Enhanced SRGAN model. It achieves consistently better visual quality with more realistic and natural textures than SRGAN and won the first place in the PIRM2018-SR Challenge. For more details, please refer to Papaer, ESRGAN repo. (If you just want to test the model, ESRGAN repo provides simpler testing codes.)

  1. SFTGAN model. It adopts Spatial Feature Transform (SFT) to effectively incorporate other conditions/priors, like semantic prior for image SR representing by segmentation probability maps. For more details, please refer to Papaer, SFTGAN repo.

BibTex

@article{wang2018esrgan,
    author={Wang, Xintao and Yu, Ke and Wu, Shixiang and Gu, Jinjin and Liu, Yihao and Dong, Chao and Loy, Chen Change and Qiao, Yu and Tang, Xiaoou},
    title={ESRGAN: Enhanced super-resolution generative adversarial networks},
    journal={arXiv preprint arXiv:1809.00219},
    year={2018}
}
@inproceedings{wang2018sftgan,
    author = {Wang, Xintao and Yu, Ke and Dong, Chao and Loy, Chen Change},
    title = {Recovering realistic texture in image super-resolution by deep spatial feature transform},
    booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    year = {2018}

Codes

The code framework and usage are detailed explained in ./codes

We also provides:

  1. Useful scripts in ./codes/scripts.
  2. We use tensorboard to visualize training loss, validation PSNR and etc. Installation and usage in tb_logger
  3. Wiki, e.g., How to make high quality gif with full (true) color, Matlab bicubic imresize

Prerequisites

  • Linux
  • Python3
  • Pytorch 0.4
  • NVIDIA GPU + CUDA

Datasets

There are some classical SR datasets, for example:

  • training datasets: BSD200, T91, General100;
  • testing datasets: Set5, Set14, urban100, BSD100, manga109, historical

You can download these classical SR datasets from Google Drive or Baidu Drive.

Currently, there is a new DIVerse 2K resolution high quality images for SR called DIV2K, which can be downloaded from DIV2K offical page, or from Baidu Drive.

Pretrained models

Pretrained models can be downloaded from Google Drive. You can put them in experiments/pretrained_models folder.

More details about the pretrained models, please see experiments/pretrained_models.


😆 Image Viewer - HandyViewer

If you have trouble in comparing image details, may have a try for HandyViewer - an image viewer that you can switch image with a fixed zoom ratio.


Acknowlegement

  • Code architecture is inspired by pytorch-cyclegan.
  • Thanks to Wai Ho Kwok, who contributes to the initial version.