Code Monkey home page Code Monkey logo

fsrcnn_tensorflow's Introduction

FSRCNN_Tensorflow

TensorFlow implementation of Accelerating the Super-Resolution Convolutional Neural Network [1].

This implementation replaces the transpose conv2d layer by a sub-pixel layer [2].

Includes pretrained models for scales x2, x3 and x4. Which were trained on T91-image dataset, and finetuned on General100 dataset.

Google Summer of Code with OpenCV

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

Requirements

  • Tensorflow
  • Python
  • Numpy
  • cv2
  • imutils

Running

Download T91, General100 and Set14.

T91 is for training. General100 for finetuning. Set14 as the validation set.

Train:

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

  • load previous
    python main.py --train --scale <scale> --traindir /path-to-train_images/ --validdir /path-to-valid_images/

  • finetune
    python main.py --train --scale <scale> --finetune --finetunedir /path-to-images/ --validdir /path-to-valid_images/

Test:
python main.py --test --image /image-path/

Export:
python3 main.py --export

Extra arguments (Fsrcnn small, batch size, lr etc.):
python main.py --h

Example

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

Notes

FSRCNN-small is a network with fewer parameters. Thus it is faster but has lower performance.

References

  1. Chao Dong, Chen Change Loy, Xiaoou Tang. Accelerating the Super-Resolution Convolutional Neural Network, in Proceedings of European Conference on Computer Vision (ECCV), 2016
  2. Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network. By Shi et. al.

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