Code Monkey home page Code Monkey logo

pytorch-edsr's Introduction

PyTorch EDSR

Implementation of CVPR2017 workshop Paper: "Enhanced Deep Residual Networks for Single Image Super-Resolution"(https://arxiv.org/pdf/1707.02921.pdf) in PyTorch

Usage

Training

usage: main_edsr.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]

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 latest checkpoint (default: none)
  --start-epoch START_EPOCH
                        manual epoch number (useful on restarts)
  --threads THREADS     number of threads for data loader to use
  --momentum MOMENTUM   momentum
  --weight-decay WEIGHT_DECAY, --wd WEIGHT_DECAY
                        weight decay, Default: 0

Test

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

PyTorch EDSR 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
  • We convert Set5 test set images to mat format using Matlab, for best PSNR performance, please use Matlab
  • An example of usage is shown as follows:
python test.py --model model/model_edsr.pth --image butterfly_GT --scale 4 --cuda

Evaluation

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

PyTorch ByNet Eval

optional arguments:
  -h, --help         Show this help message and exit
  --cuda             use cuda?
  --model MODEL      Model path. Default=model/model_epoch_40.pth
  --dataset DATASET  Dataset name, Default: Set5
  • An trained model on 291 images can be downloaded at google_drive, which could achieve 31.94dB PNSR on Set5 dataset.
  • An example of training usage is shown as follows:
python eval.py --cuda --model model/model_edsr.pth --dataset Set5

Prepare Training dataset

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

pytorch-edsr's People

Contributors

twtygqyy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.