Skip to content
Photo-Realistic Single Image Super-Resolution Using Residual Convolutional Neural Network
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Super-Resolution Network

  • Partially imported from tensorlayer/srgan.
  • Using "Group Normalization" layers instead of "Batch Normalization" layers.
  • Using "Residual of Residual Network".
  • Using "Swish" activation function instead of "ReLU".
  • Using MAE (Mean Absolute Error) loss and Sobel filter loss (high frequency loss).
  • Image data augmentation with random size cropping at random position, and random hue rotation.
  • Added compression noise removal capability by learning WebP image compression noise.
  • You can read/write PNG/WebP/BMP/JPEG/TIFF files.

System Requirements

  • Memory: 10GB RAM


We run this script under TensorFlow 1.13 and the TensorLayer 1.11.1.

  1. Install TensorFlow.

  2. Follow the instructions below to install other requirements.

cd ~/
sudo python3 -m pip install
git clone
sudo python3 -m pip install easydict
sudo apt install python3-tk
sudo apt install webp

cd ./libwebp-1.0.2
sudo make install

sudo python3 -m pip uninstall pillow
python3.6 -m pip install -U --force-reinstall pillow-simd

My Results

Original image is from iStock.

Prepare Data

  • You need to have the high resolution images for training and validation.
    • You can set the path to your training image folder via config.TRAIN.hr_img_path in
    • You can set the path to your validation image folder via config.VALID.hr_img_path in
    • Subdirectories are searched recursively.

You can use pre-trained model and re-train it.

  1. Download the ZIP file from the file storage(Yahoo! JAPAN).
  2. Unzip it.
  3. Move 2 files 'ae.npz', 'g.npz' into './SRNet-D/checkpoint/'.
  4. Run.


Start training.


Start evaluation.

  • After training, if you want to test the model, You need to put images in the specified folder.
    • You can set the path to your test images folder via config.VALID.eval_img_path in
python --mode=evaluate 

Start enlargement.

  • After training, if you want to enlarge your images, You need to put images in the specified folder.
    • You can set the path to your images folder via config.VALID.enlargement_lr_img_path in
python --mode=enlarge 


You can’t perform that action at this time.