SRCNN

November 9, 2024 · View on GitHub

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

参考:https://github.com/yjn870/SRCNN-pytorch

Differences from the original

  • Added the zero-padding
  • Used the Adam instead of the SGD
  • Removed the weights initialization

Requirements

  • paddle paddle 2.4.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.

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 150 \
                --num-workers 0 \
                --seed 123                

Test

Pre-trained weights can be found in BLAH_BLAH

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/outputs/x3/best.pdiparams" \
               --image-file "data/butterfly_GT.bmp" \
               --scale 3

Results

PSNR was calculated on the Y channel.

Set5