All Projects → yiyang7 → Super_resolution_with_cnns_and_gans

yiyang7 / Super_resolution_with_cnns_and_gans

Image Super-Resolution Using SRCNN, DRRN, SRGAN, CGAN in Pytorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Super resolution with cnns and gans

Pytorch Vdsr
VDSR (CVPR2016) pytorch implementation
Stars: ✭ 313 (+77.84%)
Mutual labels:  jupyter-notebook, super-resolution
Highres Net
Pytorch implementation of HighRes-net, a neural network for multi-frame super-resolution, trained and tested on the European Space Agency’s Kelvin competition.
Stars: ✭ 207 (+17.61%)
Mutual labels:  jupyter-notebook, super-resolution
Srflow
Official SRFlow training code: Super-Resolution using Normalizing Flow in PyTorch
Stars: ✭ 537 (+205.11%)
Mutual labels:  jupyter-notebook, super-resolution
Zoom Learn Zoom
computational zoom from raw sensor data
Stars: ✭ 224 (+27.27%)
Mutual labels:  jupyter-notebook, super-resolution
Super Resolution
Tensorflow 2.x based implementation of EDSR, WDSR and SRGAN for single image super-resolution
Stars: ✭ 952 (+440.91%)
Mutual labels:  jupyter-notebook, super-resolution
Gluon Fashionai Attributes
Stars: ✭ 176 (+0%)
Mutual labels:  jupyter-notebook
Compact bilinear pooling
MatConvNet and Caffe repo with compact bilinear and bilinear pooling functionality added
Stars: ✭ 176 (+0%)
Mutual labels:  jupyter-notebook
Attentionn
All about attention in neural networks. Soft attention, attention maps, local and global attention and multi-head attention.
Stars: ✭ 175 (-0.57%)
Mutual labels:  jupyter-notebook
Astropy Tutorials
Tutorials for the Astropy Project
Stars: ✭ 174 (-1.14%)
Mutual labels:  jupyter-notebook
Tamburetei
Fazendo de tamburete as cadeiras de [email protected]
Stars: ✭ 177 (+0.57%)
Mutual labels:  jupyter-notebook
Egg
EGG: Emergence of lanGuage in Games
Stars: ✭ 175 (-0.57%)
Mutual labels:  jupyter-notebook
S3contents
A S3 backed ContentsManager implementation for Jupyter
Stars: ✭ 175 (-0.57%)
Mutual labels:  jupyter-notebook
Reinforcement learning ai video games
Code for each week's short video of Siraj Raval Course on Reinforcement Learning "AI for Video Games"
Stars: ✭ 176 (+0%)
Mutual labels:  jupyter-notebook
Nel
Entity linking framework
Stars: ✭ 176 (+0%)
Mutual labels:  jupyter-notebook
Tech
Documentation of all collective action from tech workers.
Stars: ✭ 176 (+0%)
Mutual labels:  jupyter-notebook
Ppnp
PPNP & APPNP models from "Predict then Propagate: Graph Neural Networks meet Personalized PageRank" (ICLR 2019)
Stars: ✭ 177 (+0.57%)
Mutual labels:  jupyter-notebook
Analytical Tutorials
Tutorials for writing analytical scripts
Stars: ✭ 175 (-0.57%)
Mutual labels:  jupyter-notebook
Debiaswe
Remove problematic gender bias from word embeddings.
Stars: ✭ 175 (-0.57%)
Mutual labels:  jupyter-notebook
Jetbot
An educational AI robot based on NVIDIA Jetson Nano.
Stars: ✭ 2,391 (+1258.52%)
Mutual labels:  jupyter-notebook
Neural image captioning
Neural image captioning (NIC) implementation with Keras 2.
Stars: ✭ 176 (+0%)
Mutual labels:  jupyter-notebook

Super Resolution with CNNs and GANs

This is the code for our cs231n project.

Super Resolution with CNNs and GANs,
Yiyang Li, Yilun Xu, Ji Yu

We investigated the problem of image super-resolution (SR), where we want to reconstruct high-resolution images from low-resolution images. We presented a residual learning framework to ease the training of the substantially deep network. Specifically, we reformulated the structure of the deep-recursive neural network to improve its performance. To further improve image qualities, we built a super-resolution generative adversarial network (SRGAN) framework, where we proposed several loss functions based on perceptual loss, i.e. SSIM loss and/ or total variation (TV) loss, to enhance the structural integrity of generative images. Moreover, a condition is injected to resolve the problem of partial information loss associated with GANs.

The results show that our methods and trails can achieve equivalent performance on most of the benchmarks compared with the previous state-of-art methods, and out-perform them in terms of the structural similarity. Here are a few example outputs:

If you find this code useful in your project, please star this repository and cite:

@inproceedings{densecap,
  title={Super Resolution with CNNs and GANs},
  author={Yiyang, Li and Yilun, Xu and Ji, Yu},
  year=2018,
}

Installation

This project was implemented in PyTorch 0.4 and Python3

Quickstart

  1. Build datasets: First, you need to download the dataset. We use CelebA as our dataset. e.g for cnn_based model, we set input size 144×144 and output size 144×144; For gan model, we set input size 36×36 and output size 144×144
python build_dataset.py --data_dir ../img_align_celeba_test --output_dir ../data/cnn_faces --input_size 144 --output_size 144
  1. Train your experiment

for cnn-based models, e.g SRCNN:

python train_cnn.py --data_dir ../data/cnn_faces --model_dir experiments/srcnn_model --model srcnn --cuda cuda0 --optim adam

for gan models, e.g SRGAN:

python train_gan.py --data_dir ../data/gan_faces --model_dir experiments/gan_model --model gan --cuda cuda0 --optim adam

If you want to train the model from last time, add this:

--restore_file "best"
  1. Perform hyperparameters search e.g srcnn from cnn_based model
python search_hyperparams.py --data_dir ../data/cnn_faces --parent_dir experiments/learning_rate --model srcnn --model_type cnn
  1. Display the results of the hyperparameters search in a nice format
python synthesize_results.py --parent_dir experiments/learning_rate
  1. Evaluation on the test set

for cnn-based models, e.g SRCNN:

python evaluate_cnn.py --data_dir ../data/cnn_faces --model_dir experiments/srcnn_model --model srcnn --cuda cuda0

for gan models, e.g SRGAN:

python evaluate_gan.py --data_dir ../data/gan_faces --model_dir experiments/gan_model --model gan --cuda cuda0

Result List

  1. SRCNN
  1. DRRN
  1. SRGAN
  1. CGAN

Pre-trained Models

The following Pytorch models were trained on CelebA dataset:

  1. SRCNN(best.pth.tar)
  2. DRRN(best.pth.tar)
  3. SRGAN(best.pth.tar)
  4. CGAN(best.pth.tar)

Reference

[1] CS230 Stanford, https://github.com/cs230-stanford/, cs230-code-examples, 2018.

[2] tyshiwo, Drrn CVPR17, https://github.com/tyshiwo/DRRN_CVPR17, 2017.

[3] leftthomas, Srgan, https://github.com/leftthomas/SRGAN, 2017.

[4] znxlwm, pytorch-generative-modelcollections, https://github.com/znxlwm/pytorch-generative-model-collections, 2017.

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