GithubHelp home page GithubHelp logo

yjn870 / drrn-pytorch Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 4.0 10 KB

PyTorch implementation of Image Super-Resolution via Deep Recursive Residual Network (CVPR 2017)

Home Page: http://cvlab.cse.msu.edu/project-super-resolution.html

Python 100.00%
image-super-resolution

drrn-pytorch's Introduction

DRRN

This repository is implementation of the "Image Super-Resolution via Deep Recursive Residual Network".

Requirements

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

Prepare

The images for creating a dataset used for training (291-image) or evaluation (Set5) can be downloaded from the paper author's implementation.

You can also use pre-created dataset files with same settings as the paper.

Dataset Scale Type Link
291-image 2, 3, 4 Train Download
Set5 2 Eval Download
Set5 3 Eval Download
Set5 4 Eval Download

Generate training dataset

python generate_trainset.py --images-dir "BLAH_BLAH/Train_291" \
                            --output-path "BLAH_BLAH/Train_291_x234.h5" \
                            --patch-size 31 \
                            --stride 21

Generate test dataset

python generate_testset.py --images-dir "BLAH_BLAH/Set5" \
                           --output-path "BLAH_BLAH/Set5_x2.h5" \
                           --scale 2

Train

Model weights will be stored in the --outputs-dir after every epoch.

python train.py --train-file "BLAH_BLAH/Train_291_x234.h5" \
                --outputs-dir "BLAH_BLAH/DRRN_B1U9" \
                --B 1 \
                --U 9 \
                --num-features 128 \
                --lr 0.1 \
                --clip-grad 0.01 \
                --batch-size 128 \
                --num-epochs 50 \
                --num-workers 8 \
                --seed 123

You can also evaluate using --eval-file, --eval-scale options during training after every epoch. In addition, the best weights file will be stored in the --outputs-dir as a best.pth.

python train.py --train-file "BLAH_BLAH/Train_291_x234.h5" \
                --outputs-dir "BLAH_BLAH/DRRN_B1U9" \
                --eval-file "BLAH_BLAH/Set5_x2.h5" \
                --eval-scale 2 \
                --B 1 \
                --U 9 \
                --num-features 128 \
                --lr 0.1 \
                --clip-grad 0.01 \
                --batch-size 128 \
                --num-epochs 50 \
                --num-workers 8 \
                --seed 123

Evaluate

The pre-trained weights can be downloaded from the following links.

Model Link
DRRN_B1U9 Download
python eval.py --weights-file "BLAH_BLAH/DRRN_B1U9/best.pth" \
               --eval-file "BLAH_BLAH/Set5_x2.h5" \
               --eval-scale 2 \
               --B 1 \
               --U 9 \
               --num-features 128               

Results

The our model was learned and evaluated on the Y(luminance) channel.

For performance, we modified the original implementation as follows.

  • Batch normalization was removed from the residual unit.
  • No bias was used in the convolution layer.

Performance comparision on the Set5

Eval. Mat Scale DRRN_B1U9 (Paper) DRRN_B1U9 (Ours)
PSNR 2 37.66 37.62
PSNR 3 33.93 33.86
PSNR 4 31.58 31.52

References

  1. https://github.com/tyshiwo/DRRN_CVPR17

drrn-pytorch's People

Contributors

yjn870 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

drrn-pytorch's Issues

no BN layers?

hi,

I love your work!

just one point: I think the original paper and code applies BN layer, so you can also include BN layer in your code.

thanks

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.