Skip to content

twtygqyy/pytorch-SRDenseNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyTorch SRDenseNet

Implementation of ICCV 2017 Paper: Image Super-Resolution Using Dense Skip Connections in PyTorch

Usage

Training

usage: main.py [-h] [--batchSize BATCHSIZE] [--nEpochs NEPOCHS] [--lr LR]
               [--step STEP] [--cuda] [--resume RESUME]
               [--start-epoch START_EPOCH] [--threads THREADS]
               [--momentum MOMENTUM] [--weight-decay WEIGHT_DECAY]
               [--pretrained PRETRAINED]

PyTorch DenseNet

optional arguments:
  -h, --help            show this help message and exit
  --batchSize BATCHSIZE
                        training batch size
  --nEpochs NEPOCHS     number of epochs to train for
  --lr LR               Learning Rate. Default=1e-4
  --step STEP           Sets the learning rate to the initial LR decayed by
                        momentum every n epochs, Default: n=10
  --cuda                Use cuda?
  --resume RESUME       Path to checkpoint (default: none)
  --start-epoch START_EPOCH
                        Manual epoch number (useful on restarts)
  --threads THREADS     Number of threads for data loader to use, Default: 1
  --momentum MOMENTUM   Momentum, Default: 0.9
  --weight-decay WEIGHT_DECAY, --wd WEIGHT_DECAY
                        weight decay, Default: 1e-4
  --pretrained PRETRAINED
                        path to pretrained model (default: none)

An example of training usage is shown as follows:

python main.py --cuda

Evaluation

usage: eval.py [-h] [--cuda] [--model MODEL] [--dataset DATASET]
               [--scale SCALE]

PyTorch SRDenseNet Eval

optional arguments:
  -h, --help         show this help message and exit
  --cuda             use cuda?
  --model MODEL      model path
  --dataset DATASET  dataset name, Default: Set5
  --scale SCALE      scale factor, Default: 4

An example of evalutation usage is shown as follows:

python eval.py --cuda

Demo

usage: demo.py [-h] [--cuda] [--model MODEL] [--image IMAGE] [--scale SCALE]

PyTorch SRDenseNet Test

optional arguments:
  -h, --help     show this help message and exit
  --cuda         use cuda?
  --model MODEL  model path
  --image IMAGE  image name
  --scale SCALE  scale factor, Default: 4

An example of demo usage is shown as follows:

python demo.py --model model_adam/model_epoch_60.pth --image butterfly_GT --scale 4 --cuda

Prepare Training dataset

  • Please refer Code for Data Generation for creating training files.
  • Data augmentations including flipping, rotation, downsizing are adopted.

Performance

  • So far performance in PSNR is not as good as paper, since we only used 30,000 images for training while the authors used 50,000 images.
Dataset SRDenseNet Paper SRDenseNet PyTorch
Set5 32.02 31.58
Set14 28.50 28.36
BSD100 27.53 27.38

Misc.

Releases

No releases published

Packages

No packages published