Giter Site home page Giter Site logo

anu-prakash-dev / edsr_tensorflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saafke/edsr_tensorflow

0.0 0.0 0.0 162.5 MB

TensorFlow implementation of 'Enhanced Deep Residual Networks for Single Image Super-Resolution'.

License: Apache License 2.0

Python 100.00%

edsr_tensorflow's Introduction

EDSR in Tensorflow

TensorFlow implementation of Enhanced Deep Residual Networks for Single Image Super-Resolution[1].

It was trained on the Div2K dataset - Train Data (HR images).

Google Summer of Code with OpenCV

This repository was made during the 2019 GSoC program for the organization OpenCV. The trained models (.pb files) can easily be used for inference in OpenCV with the 'dnn_superres' module. See the OpenCV documentation for how to do this.

Requirements

  • tensorflow
  • numpy
  • cv2

EDSR

This is the EDSR model, which has a different model for each scale. Architecture shown below. Go to branch 'mdsr' for the MDSR model.

Alt text

Running

Download Div2K dataset. If you want to use another dataset, you will have to calculate the mean of that dataset, and set the new mean in 'main.py'. Code for calculating the mean can be found in data_utils.py.

Train:

  • from scratch python main.py --train --fromscratch --scale <scale> --traindir /path-to-train-images/

  • resume/load previous python main.py --train --scale <scale> --traindir /path-to-train-images/

Test (compares edsr with bicubic with PSNR metric): python main.py --test --scale <scale> --image /path-to-image/

Upscale (with edsr): python main.py --upscale --scale <scale> --image /path-to-image/

Export to .pb python main.py --export --scale <scale>

Extra arguments (Nr of resblocks, filters, batch, lr etc.) python main.py --help

Example

(1) Original picture
(2) Input image
(3) Bicubic scaled (3x) image
(4) EDSR scaled (3x) image
Alt text Alt text Alt text Alt text

Notes

The .pb files in these repository are quantized. This is done purely to shrink the filesizes down from ~150MB to ~40MB, because GitHub does not allow uploads above 100MB. The performance loss due to quantization is minimal. (To quantize during exporting use $ --quant <1,2 or 3> (2 is recommended.))

References

[1] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Kyoung Mu Lee, "Enhanced Deep Residual Networks for Single Image Super-Resolution," 2nd NTIRE: New Trends in Image Restoration and Enhancement workshop and challenge on image super-resolution in conjunction with CVPR 2017. [PDF] [arXiv] [Slide]

edsr_tensorflow's People

Contributors

saafke 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.