Coder Social home page Coder Social logo

saafke / fsrcnn_tensorflow Goto Github PK

View Code? Open in Web Editor NEW
111.0 5.0 43.0 2.35 MB

Tensorflow implementation of 'Accelerating the Super-Resolution Convolutional Neural Network'.

License: Apache License 2.0

Python 100.00%
fsrcnn fsrcnn-tensorflow super-resolution super resolution opencv

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

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

fsrcnn_tensorflow's Issues

> Hi,

I am pretty sure it was python 2.7, although I am not sure about TensorFlow, my guess would be 1.12.0. I can double-check for you somewhere later this week. It should work with most combinations though. Could you perhaps show me the exact error you are getting?

Originally posted by @Saafke in #1 (comment)

I don't think so. Because in the python2.7, The function of 'print' no ()

one question about scaling of images

Hi again Saafke,
i wanted to quest you something.When we augment our data using scaling with 0.6 , 0.7, 0.8, 0.9 factor then we have to downscale them again with the scale factor(2 or 3 or 4) to produce the training data?

First_error

Traceback (most recent call last):
File "/content/FSRCNN_Tensorflow/main.py", line 2, in
import fsrcnn
File "/content/FSRCNN_Tensorflow/fsrcnn.py", line 8
def model(x, y, lr_size, scale, batch, lr, (d, s, m)):
^
SyntaxError: invalid syntax

when beginning, it's wrong.

version of tensorflow and python

Hi,
I wonder the version of tensorflow and python. I run the code and it gives me message that the version is not matched.

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.