GithubHelp home page GithubHelp logo

srcnn-tensorflow's Introduction

SRCNN-Tensorflow (2018/08/15)

Introduction

We implement a tensorflow model for "Image Super-Resolution Using Deep Convolutional Networks"

  • We use 91 dataset as training dataset.

Environment

  • Ubuntu 16.04
  • Python 3.5

Depenency

  • Numpy
  • Opencv2
  • matplotlib

Files

  • main.py : Execute train.py and pass the default value.
  • srcnn.py : srcnn model definition.
  • train.py : Train the SRCNN model and represent the test performance.
  • test.py : Test the SRCNN model and show result images and psnr.
  • demo.py : Upscale a input image by SRCNN model.
  • log.txt : The log of training process.
  • model : The save files of the trained srcnn.

How to use

Pre-processing

You should put the images of the 91 dataset into the '91' directory in the 'data' directory.

Step 1

You should execute aug_train.m and aug_test.m in 'data' directory.
Recommend 'Octave' platform to execute matlab code '.m'

Step 2 (Final)

You should execute preprocess.py in 'data' directory.
python preprocess.py

Training

python main.py

# if you want to change training epoch ex) 1500 epoch (default) -> 2000 epoch
python main.py --training_epoch 2000

Test

python test.py

# Default args: image_index = 1, scale = 2, coordinate = [50,50], interval = 30 
# You can change args: image_index = 13, scale = 4, coorindate [100,100], interval = 50
python test.py --image_index 13 --scale 4 --coordinate [100,100] --interval 50

Demo

python demo.py

# Default args: scale = 2
# You can change arg: scale = 4
python demo.py --scale 4

Result

Results on Set 5
PSNR on Y channel
Scale Bicubic tf_SRCNN
2x - PSNR 33.33 34.92
Results on Urban 100 (visual)
  • Original (Urban100 / index 1)

    Imgur

  • Bicubic (Urban100 / index 1)

    Imgur

  • SRCNN (Urban100 / index 1)

    Imgur

srcnn-tensorflow's People

Contributors

devkihyun avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

srcnn-tensorflow's Issues

The result psnr is different from the log of github.

Dear Sir, I have ran your code which is a good project. However, the result of mine are different from your log file.In my result, the PSNR of bicubic is 33.65, and the PSNR of SRCNN is always below 36.50. Do you know why? Look forward to your reply,thank you for your help.

Error in psnr function

I am getting the following error. Should I convert to numpy array or something to solve?
I have python 3.5.6 version in anaconda environment

Traceback (most recent call last):
File "main.py", line 20, in
train.training(SRCNN, args)
File "../SRCNN/train.py", line 43, in training
_psnr = psnr(test_labels[i], test_inputs[i], peak=1)
File "../SRCNN/util.py", line 182, in psnr
x = x.astype(np.float32)
AttributeError: 'int' object has no attribute 'astype'

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.