Skip to content

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

License

Notifications You must be signed in to change notification settings

Saafke/FSRCNN_Tensorflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages