GithubHelp home page GithubHelp logo

stojakovic312636841 / espcn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leftthomas/espcn

0.0 2.0 0.0 20.6 MB

A PyTorch implementation of ESPCN based on CVPR2016 paper "Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network"

Python 100.00%

espcn's Introduction

ESPCN

A PyTorch implementation of ESPCN based on CVPR2016 paper Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network

Requirements

conda install pytorch torchvision -c soumith
conda install pytorch torchvision cuda80 -c soumith # install it if you have installed cuda
  • PyTorchNet
pip install git+https://github.com/pytorch/tnt.git@master
  • tqdm
pip install tqdm
  • opencv
conda install -c conda-forge opencv

Datasets

Train、Val Dataset

The train and val datasets are sampled from VOC2012. Train dataset has 16700 images and Val dataset has 425 images. Download the datasets from here, and then extract it into data directory. Finally run

python data_utils.py

optional arguments:
--upscale_factor      super resolution upscale factor [default value is 3]

to generate train and val datasets from VOC2012 with given upscale factors(options: 2、3、4、8).

Test Image Dataset

The test image dataset are sampled from | Set 5 | Bevilacqua et al. BMVC 2012 | Set 14 | Zeyde et al. LNCS 2010 | BSD 100 | Martin et al. ICCV 2001 | Sun-Hays 80 | Sun and Hays ICCP 2012 | Urban 100 | Huang et al. CVPR 2015. Download the image dataset from here, and then extract it into data directory.

Test Video Dataset

The test dataset are sampled from Jay Chou's Music Videos. Download the video dataset from here, and then extract it into data/test/SRF_xx/video directory, which xx means the upscale factor.

Usage

Train

python -m visdom.server & python train.py

optional arguments:
--upscale_factor      super resolution upscale factor [default value is 3]
--num_epochs          super resolution epochs number [default value is 100]

Visdom now can be accessed by going to 127.0.0.1:8097 in your browser, or your own host address if specified.

If the above does not work, try using an SSH tunnel to your server by adding the following line to your local ~/.ssh/config : LocalForward 127.0.0.1:8097 127.0.0.1:8097.

Maybe if you are in China, you should download the static resources from here, and put them on ~/anaconda3/lib/python3.6/site-packages/visdom/static/.

Test Image

python test_image.py

optional arguments:
--upscale_factor      super resolution upscale factor [default value is 3]
--model_name          super resolution model name [default value is epoch_3_100.pt]

The output high resolution images are on results directory.

Test Video

python test_video.py

optional arguments:
--upscale_factor      super resolution upscale factor [default value is 3]
--is_real_time        super resolution real time to show [default value is False]
--delay_time          super resolution delay time to show [default value is 1]
--model_name          super resolution model name [default value is epoch_3_100.pt]

The output high resolution videos are on results directory.

Benchmarks

Adam optimizer were used with learning rate scheduling between epoch 30 and epoch 80.

Upscale Factor = 2

Epochs with batch size of 64 takes ~1 minute on a NVIDIA GeForce TITAN X GPU.

Loss/PSNR graphs

Image Results

The left is low resolution image, the middle is high resolution image, and the right is super resolution image(output of the ESPCN).

  • Set5
  • Set14
  • BSD100
  • Urban100

Video Results

The right is low resolution video, the left is super resolution video(output of the ESPCN). Click the image to watch the complete video.

Watch the video

Upscale Factor = 3

Epochs with batch size of 64 takes ~30 seconds on a NVIDIA GeForce TITAN X GPU.

Loss/PSNR graphs

Image Results

The left is low resolution image, the middle is high resolution image, and the right is super resolution image(output of the ESPCN).

  • Set5
  • Set14
  • BSD100

Video Results

The right is low resolution video, the left is super resolution video(output of the ESPCN). Click the image to watch the complete video.

Watch the video

Upscale Factor = 4

Epochs with batch size of 64 takes ~20 seconds on a NVIDIA GeForce GTX 1070 GPU.

Loss/PSNR graphs

Image Results

The left is low resolution image, the middle is high resolution image, and the right is super resolution image(output of the ESPCN).

  • Set5
  • Set14
  • BSD100
  • Urban100

Video Results

The right is low resolution video, the left is super resolution video(output of the ESPCN). Click the image to watch the complete video.

Watch the video

Upscale Factor = 8

Epochs with batch size of 64 takes ~15 seconds on a NVIDIA GeForce GTX 1070 GPU.

Loss/PSNR graphs

Image Results

The left is low resolution image, the middle is high resolution image, and the right is super resolution image(output of the ESPCN).

  • SunHays80

Video Results

The left is low resolution video, the right is super resolution video(output of the ESPCN). Click the image to watch the complete video.

Watch the video

The complete test image results could be downloaded from here, and the complete test video results could be downloaded from here.

espcn's People

Contributors

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