GithubHelp home page GithubHelp logo

edsr-tensorlfow's Introduction

EDSR Tensorflow Implementation

An implementation of Enhanced Deep Residual Networks for Single Image Super-Resolution written in tensorflow.

Requirements

  • Tensorflow
  • scipy
  • tqdm
  • argparse

Installation

pip install -r requirements.txt

Training

In order to train, you'll have to do a few things...

  • Download a dataset of images (due to my computational limitations, I've used General-100)
  • Place all the images from that dataset into a directory under this one
  • run python train.py --dataset data_dir where data_dir is the directory containing your images
  • In order to view stats during training (image previews, scalar for loss), simply run tensorboard --logdir your_save_directory where your_save_directory is the directory you passed in as the save directory argument for training (saved_models by default)

Training Details

As I've mentioned before, I'm currently faced with some computational limitations, so this caused me to do a few things differently than what is mentioned in the paper. One of the more important changes I've made was using the General-100 dataset, because it's much smaller. I've also trained a network with less layers than the original baseline model as was described in the paper. This, however, can still be done using my code by adjusting some training parameters. I've trained by taking the center 100x100 pixels of each image in General-100, and shrinking them down to 50x50. I then trained an EDSR to resize the 50x50 pixel images back to 100x100. Currently, I use 80% of the dataset as a training set and 20% as a testing set. I trained the EDSR over 1000 iterations using Adam optimizer

Using Trained Network

In order to use trained weights you just have to run this command python test.py. By default, this will take a random sample of five images from your dataset, compute their output, and save it in the out directory. If you'd like to just run superresolution on one image, you can run python test.py --image your_picture where your_picture is the image file you'd like to run superresolution on.

Results

These results were computed on a network using 3 layers, and a feature size of 16. The network was trained to scale 50x50px images to 100x100px for 1000 iterations.

Updates coming soon.......

Original image Shrunk image EDSR Output
alt-text alt-text alt-text
alt-text alt-text alt-text
alt-text alt-text alt-text
alt-text alt-text alt-text
alt-text alt-text alt-text

Future Work

  • Add MDSR implementation
  • Train and post results on a larger model and dataset

Pre-trained model

There is a pre-trained model that I have made for the baseline model (default params) using my machine. If you'd like to use it, download the files here. In order to run, create a directory called saved_models and place the files in there. Then you can use test.py to resize images.

edsr-tensorlfow

edsr-tensorlfow's People

Contributors

stojakovic312636841 avatar

Watchers

James Cloos avatar paper2code - bot 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.