Home

Awesome

SRCNN

This repository is implementation of the "Image Super-Resolution Using Deep Convolutional Networks".

<center><img src="./thumbnails/fig1.png"></center>

Differences from the original

Requirements

Train

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

DatasetScaleTypeLink
91-image2TrainDownload
91-image3TrainDownload
91-image4TrainDownload
Set52EvalDownload
Set53EvalDownload
Set54EvalDownload

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-4 \
                --batch-size 16 \
                --num-epochs 400 \
                --num-workers 8 \
                --seed 123                

Test

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

ModelScaleLink
9-5-52Download
9-5-53Download
9-5-54Download

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

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

Results

We used the network settings for experiments, i.e., <a href="https://www.codecogs.com/eqnedit.php?latex={&space;f&space;}_{&space;1&space;}=9,{&space;f&space;}_{&space;2&space;}=5,{&space;f&space;}_{&space;3&space;}=5,{&space;n&space;}_{&space;1&space;}=64,{&space;n&space;}_{&space;2&space;}=32,{&space;n&space;}_{&space;3&space;}=1" target="_blank"><img src="https://latex.codecogs.com/gif.latex?{&space;f&space;}_{&space;1&space;}=9,{&space;f&space;}_{&space;2&space;}=5,{&space;f&space;}_{&space;3&space;}=5,{&space;n&space;}_{&space;1&space;}=64,{&space;n&space;}_{&space;2&space;}=32,{&space;n&space;}_{&space;3&space;}=1" title="{ f }_{ 1 }=9,{ f }_{ 2 }=5,{ f }_{ 3 }=5,{ n }_{ 1 }=64,{ n }_{ 2 }=32,{ n }_{ 3 }=1" /></a>.

PSNR was calculated on the Y channel.

Set5

Eval. MatScaleSRCNNSRCNN (Ours)
PSNR236.6636.65
PSNR332.7533.29
PSNR430.4930.25
<table> <tr> <td><center>Original</center></td> <td><center>BICUBIC x3</center></td> <td><center>SRCNN x3 (27.53 dB)</center></td> </tr> <tr> <td> <center><img src="./data/butterfly_GT.bmp""></center> </td> <td> <center><img src="./data/butterfly_GT_bicubic_x3.bmp"></center> </td> <td> <center><img src="./data/butterfly_GT_srcnn_x3.bmp"></center> </td> </tr> <tr> <td><center>Original</center></td> <td><center>BICUBIC x3</center></td> <td><center>SRCNN x3 (29.30 dB)</center></td> </tr> <tr> <td> <center><img src="./data/zebra.bmp""></center> </td> <td> <center><img src="./data/zebra_bicubic_x3.bmp"></center> </td> <td> <center><img src="./data/zebra_srcnn_x3.bmp"></center> </td> </tr> <tr> <td><center>Original</center></td> <td><center>BICUBIC x3</center></td> <td><center>SRCNN x3 (28.58 dB)</center></td> </tr> <tr> <td> <center><img src="./data/ppt3.bmp""></center> </td> <td> <center><img src="./data/ppt3_bicubic_x3.bmp"></center> </td> <td> <center><img src="./data/ppt3_srcnn_x3.bmp"></center> </td> </tr> </table>