/ESPCN-pytorch

PyTorch implementation of Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network (CVPR 2016)

Primary LanguagePython

ESPCN

This repository is implementation of the "Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network".

Requirements

  • PyTorch 1.0.0
  • Numpy 1.15.4
  • Pillow 5.4.1
  • h5py 2.8.0
  • tqdm 4.30.0

Train

The 91-image, Set5 dataset converted to HDF5 can be downloaded from the links below.

Dataset Scale Type Link
91-image 3 Train Download
Set5 3 Eval Download

Otherwise, you can use prepare.py to create custom dataset.

python train.py --train-file "BLAH_BLAH/91-image_x3.h5" \
                --eval-file "BLAH_BLAH/Set5_x3.h5" \
                --outputs-dir "BLAH_BLAH/outputs" \
                --scale 3 \
                --lr 1e-3 \
                --batch-size 16 \
                --num-epochs 200 \
                --num-workers 8 \
                --seed 123                

Test

Pre-trained weights can be downloaded from the links below.

Model Scale Link
ESPCN (91) 3 Download

The results are stored in the same path as the query image.

python test.py --weights-file "BLAH_BLAH/espcn_x3.pth" \
               --image-file "data/butterfly_GT.bmp" \
               --scale 3

Results

PSNR was calculated on the Y channel.

Set5

Eval. Mat Scale Paper (91) Ours (91)
PSNR 3 32.55 32.88
Original BICUBIC x3 ESPCN x3 (23.84 dB)
Original BICUBIC x3 ESPCN x3 (25.32 dB)