All Projects → HasnainRaz → Fast Srgan

HasnainRaz / Fast Srgan

Licence: mit
A Fast Deep Learning Model to Upsample Low Resolution Videos to High Resolution at 30fps

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Fast Srgan

Iseebetter
iSeeBetter: Spatio-Temporal Video Super Resolution using Recurrent-Generative Back-Projection Networks | Python3 | PyTorch | GANs | CNNs | ResNets | RNNs | Published in Springer Journal of Computational Visual Media, September 2020, Tsinghua University Press
Stars: ✭ 202 (-51.56%)
Mutual labels:  cnn, generative-adversarial-network, super-resolution, gans
DLSS
Deep Learning Super Sampling with Deep Convolutional Generative Adversarial Networks.
Stars: ✭ 88 (-78.9%)
Mutual labels:  cnn, generative-adversarial-network, gans, super-resolution
Srgan Tensorflow
Tensorflow implementation of the SRGAN algorithm for single image super-resolution
Stars: ✭ 754 (+80.82%)
Mutual labels:  cnn, generative-adversarial-network, super-resolution
pytorch-gans
PyTorch implementation of GANs (Generative Adversarial Networks). DCGAN, Pix2Pix, CycleGAN, SRGAN
Stars: ✭ 21 (-94.96%)
Mutual labels:  generative-adversarial-network, gans, super-resolution
A Pytorch Tutorial To Super Resolution
Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network | a PyTorch Tutorial to Super-Resolution
Stars: ✭ 157 (-62.35%)
Mutual labels:  generative-adversarial-network, super-resolution, gans
Gans In Action
Companion repository to GANs in Action: Deep learning with Generative Adversarial Networks
Stars: ✭ 748 (+79.38%)
Mutual labels:  artificial-intelligence, generative-adversarial-network, gans
Deep Learning With Python
Deep learning codes and projects using Python
Stars: ✭ 195 (-53.24%)
Mutual labels:  artificial-intelligence, cnn, generative-adversarial-network
Pytorch Srgan
A modern PyTorch implementation of SRGAN
Stars: ✭ 289 (-30.7%)
Mutual labels:  cnn, generative-adversarial-network, super-resolution
gans-collection.torch
Torch implementation of various types of GAN (e.g. DCGAN, ALI, Context-encoder, DiscoGAN, CycleGAN, EBGAN, LSGAN)
Stars: ✭ 53 (-87.29%)
Mutual labels:  generative-adversarial-network, gans
skip-thought-gan
Generating Text through Adversarial Training(GAN) using Skip-Thought Vectors
Stars: ✭ 44 (-89.45%)
Mutual labels:  generative-adversarial-network, gans
Deep-Learning
It contains the coursework and the practice I have done while learning Deep Learning.🚀 👨‍💻💥 🚩🌈
Stars: ✭ 21 (-94.96%)
Mutual labels:  generative-adversarial-network, gans
AvatarGAN
Generate Cartoon Images using Generative Adversarial Network
Stars: ✭ 24 (-94.24%)
Mutual labels:  generative-adversarial-network, gans
srgan
Pytorch implementation of "Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network"
Stars: ✭ 39 (-90.65%)
Mutual labels:  generative-adversarial-network, super-resolution
esrgan
Enhanced SRGAN. Champion PIRM Challenge on Perceptual Super-Resolution
Stars: ✭ 48 (-88.49%)
Mutual labels:  generative-adversarial-network, super-resolution
Generative models tutorial with demo
Generative Models Tutorial with Demo: Bayesian Classifier Sampling, Variational Auto Encoder (VAE), Generative Adversial Networks (GANs), Popular GANs Architectures, Auto-Regressive Models, Important Generative Model Papers, Courses, etc..
Stars: ✭ 276 (-33.81%)
Mutual labels:  generative-adversarial-network, gans
Caffe Hrt
Heterogeneous Run Time version of Caffe. Added heterogeneous capabilities to the Caffe, uses heterogeneous computing infrastructure framework to speed up Deep Learning on Arm-based heterogeneous embedded platform. It also retains all the features of the original Caffe architecture which users deploy their applications seamlessly.
Stars: ✭ 271 (-35.01%)
Mutual labels:  artificial-intelligence, cnn
gan-vae-pretrained-pytorch
Pretrained GANs + VAEs + classifiers for MNIST/CIFAR in pytorch.
Stars: ✭ 134 (-67.87%)
Mutual labels:  generative-adversarial-network, gans
RCAN-tf
TensorFlow code for ECCV 2018 paper "Image Super-Resolution Using Very Deep Residual Channel Attention Networks"
Stars: ✭ 25 (-94%)
Mutual labels:  cnn, super-resolution
Faceswap Gan
A denoising autoencoder + adversarial losses and attention mechanisms for face swapping.
Stars: ✭ 3,099 (+643.17%)
Mutual labels:  generative-adversarial-network, gans
Text Classification Cnn Rnn
CNN-RNN中文文本分类,基于TensorFlow
Stars: ✭ 3,613 (+766.43%)
Mutual labels:  cnn, tensorboard

Fast-SRGAN

The goal of this repository is to enable real time super resolution for upsampling low resolution videos. Currently, the design follows the SR-GAN architecture. But instead of residual blocks, inverted residual blocks are employed for parameter efficiency and fast operation. This idea is somewhat inspired by Real time image enhancement GANs.

The training setup looks like the following diagram:

Speed Benchmarks

The following runtimes/fps are obtained by averaging runtimes over 800 frames. Measured on a GTX 1080.

Input Image Size Output Size Time (s) FPS
128x128 512x512 0.019 52
256x256 1024x1024 0.034 30
384x384 1536x1536 0.068 15

We see it's possible to upsample to 720p at around 30fps.

Requirements

This was tested on Python 3.7. To install the required packages, use the provided requirements.txt file like so:

pip install -r requirements.txt

Pre-trained Model

A pretrained generator model on the DIV2k dataset is provided in the 'models' directory. It uses 6 inverted residual blocks, with 32 filters in every layer of the generator.

Upsampling is done via phase shifts in the low resolution space for speed.

To try out the provided pretrained model on your own images, run the following:

python infer.py --image_dir 'path/to/your/image/directory' --output_dir 'path/to/save/super/resolution/images'

Training

To train, simply execute the following command in your terminal:

python main.py --image_dir 'path/to/image/directory' --hr_size 384 --lr 1e-4 --save_iter 200 --epochs 10 --batch_size 14

Model checkpoints and training summaries are saved in tensorboard. To monitor training progress, open up tensorboard by pointing it to the 'logs' directory that will created when you start training.

Samples

Following are some results from the provided trained model. Left shows the low res image, after 4x bicubic upsampling. Middle is the output of the model. Right is the actual high resolution image.

384x384 to 1536x1536 Upsampling 256x256 to 1024x1024 Upsampling 128x128 to 512x512 Upsampling

Extreme Super Resolution

Upsampling HQ images 4x as a check to see the image is not destroyed (since the network is trained on low quality, it should also upsample high quality images while preserving their quality).

Changing Input Size

The provided model was trained on 384x384 inputs, but to run it on inputs of arbitrary size, you'll have to change the input shape like so:

from tensorflow import keras

# Load the model
model = keras.models.load_model('models/generator.h5')

# Define arbitrary spatial dims, and 3 channels.
inputs = keras.Input((None, None, 3))

# Trace out the graph using the input:
outputs = model(inputs)

# Override the model:
model = keras.models.Model(inputs, outputs)

# Now you are free to predict on images of any size.

Contributing

If you have ideas on improving model performance, adding metrics, or any other changes, please make a pull request or open an issue. I'd be happy to accept any contributions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].