Giter Club home page Giter Club logo

super-resolution-videos's Introduction

Super resolve videos

Applying SRGAN technique implemented in https://github.com/zsdonghao/SRGAN on videos to super resolve them. You can find some of our results here- https://www.youtube.com/watch?v=8OY8HFGsbKM . With various modification to the loss methods one can obtain results which match their goals.

Motivation

One of the state of the art techniques at the time of writing, to super resolve an image involves the SRGAN technique as described in the paper. We investigated the effects of trying this technique on videos, and observed that we can super resolve them without major distortions, though some changes to the loss functions were necessary to remove certain flickering effects.

Implementation

This repository gives you a framework to choose any video within the videos folder and super reolve it by 4x. Our code works well for most of the videos we have tested. We have added an L1 loss in the training code to get rid of the flickering frames problem found in videos that were super rewsolved using plain SRGANs.

NOTE: The trained models are present in the folder Generator_Models.

  1. g_srgan.npz: trained model obtained from the original paper without the loss modifications.
  2. g_srgan_L1.npz: trained model with L1 loss to reduce the flickering effect.

Running the script

Provided that the repository has access to the trained model, the entry point to this project would be via the supervideo.py file. This files lists the video files present in the videos folder. The repository as is, is void of any videos. So go ahead and place any number of videos in this folder.

  1. To execute this, please run python supervideo.py
  2. Select the desired video from the list.
  3. Once the operation is successful the video will be present in the same folder with _srgan suffix.

Dependencies

  1. Python environment
  2. Working TensorFlow installation
  3. Working TensorLayer installation
  4. Python skvideo package
  5. ffmpeg tool

FAQs

1. Getting memory errors

Reduce the resolution of the input video. As this code tries to super-resolve the video by 4x, if one tries to super resolve 1080p video, one needs video card memory that can handle 1080x4 pixels. Sometimes, a video might have a high resolution theoretically, but may just contain noise/ pixelated information. Reducing the resolution, reduces the file size without noticeable quality degradation.

2. ffmpeg tool not found. Please have download all the necessary dependencies.

Please install ffmpeg tool/ any other tools that were not found.

3. How do I train my model?

We have not included the code for training the models in this repository. We used https://github.com/tensorlayer/srgan/blob/master/main.py, to train our models as well. Please star their repository if you find this technique useful. :)

4. I have trained my model, how do I use it?

Once you have a trained model, go ahead and place it in the Generator_Models folder. Then go here (line 65) and put your model's name instead of the current "g_srgan.npz." You are all set to super resolve a video using this model now.

super-resolution-videos's People

Contributors

kevinjoseph1995 avatar ravisvi 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.