Skip to content
Photo-Realistic Single Image Super-Resolution Using Residual Convolutional Neural Network
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
HRImage_Training
HRImage_Validation
LRImage_Evaluation
checkpoint
img
samples
.gitignore
.style.yapf
README.md
config.py
download_imagenet.py
main.py
model.py
utils.py

README.md

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

Preparation

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 https://github.com/tensorlayer/tensorlayer/archive/1.11.1.zip
git clone https://github.com/ImpactCrater/SRNet-D.git
sudo python3 -m pip install easydict
sudo apt install python3-tk
sudo apt install webp

wget https://github.com/webmproject/libwebp/archive/v1.0.2.zip
unzip v1.0.2.zip
cd ./libwebp-1.0.2
./autogen.sh
./configure
make
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 config.py.
    • You can set the path to your validation image folder via config.VALID.hr_img_path in config.py.
    • 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.

Run

Start training.

python main.py

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 config.py.
python main.py --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 config.py.
python main.py --mode=enlarge 

License

You can’t perform that action at this time.