All Projects → krshrimali → DCGAN-CelebA-PyTorch-CPP

krshrimali / DCGAN-CelebA-PyTorch-CPP

Licence: other
DCGAN Implementation using PyTorch in both C++ and Python

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
shell
77523 projects
CMake
9771 projects

Projects that are alternatives of or similar to DCGAN-CelebA-PyTorch-CPP

Gan Tutorial
Simple Implementation of many GAN models with PyTorch.
Stars: ✭ 227 (+1521.43%)
Mutual labels:  gan, dcgan, celeba
Tf.gans Comparison
Implementations of (theoretical) generative adversarial networks and comparison without cherry-picking
Stars: ✭ 477 (+3307.14%)
Mutual labels:  gan, dcgan, celeba
Pycadl
Python package with source code from the course "Creative Applications of Deep Learning w/ TensorFlow"
Stars: ✭ 356 (+2442.86%)
Mutual labels:  gan, dcgan, celeba
Tensorflow DCGAN
Study Friendly Implementation of DCGAN in Tensorflow
Stars: ✭ 22 (+57.14%)
Mutual labels:  gan, dcgan, celeba
Pytorch Mnist Celeba Gan Dcgan
Pytorch implementation of Generative Adversarial Networks (GAN) and Deep Convolutional Generative Adversarial Networks (DCGAN) for MNIST and CelebA datasets
Stars: ✭ 363 (+2492.86%)
Mutual labels:  gan, dcgan, celeba
Tf Exercise Gan
Tensorflow implementation of different GANs and their comparisions
Stars: ✭ 110 (+685.71%)
Mutual labels:  gan, dcgan, celeba
Unsupervised-Anomaly-Detection-with-Generative-Adversarial-Networks
Unsupervised Anomaly Detection with Generative Adversarial Networks on MIAS dataset
Stars: ✭ 95 (+578.57%)
Mutual labels:  gan, dcgan
Gan
Resources and Implementations of Generative Adversarial Nets: GAN, DCGAN, WGAN, CGAN, InfoGAN
Stars: ✭ 2,127 (+15092.86%)
Mutual labels:  gan, dcgan
Image generator
DCGAN image generator 🖼️.
Stars: ✭ 173 (+1135.71%)
Mutual labels:  gan, dcgan
Anogan Tf
Unofficial Tensorflow Implementation of AnoGAN (Anomaly GAN)
Stars: ✭ 218 (+1457.14%)
Mutual labels:  gan, dcgan
Deep Learning With Python
Example projects I completed to understand Deep Learning techniques with Tensorflow. Please note that I do no longer maintain this repository.
Stars: ✭ 134 (+857.14%)
Mutual labels:  gan, dcgan
Catdcgan
A DCGAN that generate Cat pictures 🐱‍💻
Stars: ✭ 177 (+1164.29%)
Mutual labels:  gan, dcgan
DCGAN-Pytorch
A Pytorch implementation of "Deep Convolutional Generative Adversarial Networks"
Stars: ✭ 23 (+64.29%)
Mutual labels:  dcgan, celeba
Face generator
DCGAN face generator 🧑.
Stars: ✭ 146 (+942.86%)
Mutual labels:  gan, dcgan
Semantic image inpainting
Semantic Image Inpainting
Stars: ✭ 140 (+900%)
Mutual labels:  gan, dcgan
Tensorflow Mnist Gan Dcgan
Tensorflow implementation of Generative Adversarial Networks (GAN) and Deep Convolutional Generative Adversarial Netwokrs for MNIST dataset.
Stars: ✭ 163 (+1064.29%)
Mutual labels:  gan, dcgan
Generative adversarial networks 101
Keras implementations of Generative Adversarial Networks. GANs, DCGAN, CGAN, CCGAN, WGAN and LSGAN models with MNIST and CIFAR-10 datasets.
Stars: ✭ 138 (+885.71%)
Mutual labels:  gan, dcgan
dcgan anime avatars
基于keras使用dcgan自动生成动漫头像
Stars: ✭ 37 (+164.29%)
Mutual labels:  gan, dcgan
GANs-Keras
GANs Implementations in Keras
Stars: ✭ 24 (+71.43%)
Mutual labels:  gan, dcgan
catgan pytorch
Unsupervised and Semi-supervised Learning with Categorical Generative Adversarial Networks
Stars: ✭ 50 (+257.14%)
Mutual labels:  gan, dcgan

DCGAN-CelebA-PyTorch-CPP

DCGAN Implementation (on CelebA dataset) using PyTorch C++ Frontend API (Libtorch)

  • Training Code location: src/main.cpp
  • Generator and Discriminator Definition: include/network.hpp
  • Dataset Class: include/dataset.hpp and src/dataset.cpp
  • Tested on Libtorch Version: Stable 1.4.0 (cxx11 ABI) with and without CUDA (10.1), Linux, OpenCV 4.1.0

How is this different from dcgan sample of PyTorch?

  1. This loads a custom dataset (which is not in the dataset class of PyTorch) - CelebA.
  2. Since some users prefer using Sequential Modules, so this example uses Sequential Module.

Utility Functions (to visualize images & create animation), and architecture is inherited from the PyTorch Example on DCGAN (https://github.com/pytorch/examples/blob/master/cpp/dcgan/).

Please note that this is in no way targeted to achieve a certain accuracy, but only focuses on creating an example template for DCGAN using Libtorch on CelebA Dataset.

Steps to Follow

Note: This project requires OpenCV built from source. Make sure you also have Pillow (to save animation), NumPy, Matplotlib for running files in utils/ folder.

  1. Create a build directory: mkdir build/
  2. Change the directory path (absolute path) to libtorch in CMakeLists.txt file. Then configure using CMake: cmake ..
  3. Create an output directory (in the build directory) to store the results & save checkpoints: mkdir output/
  4. Build your project: make
  5. Execute: ./bin/example/
  6. The saved checkpoints and outputs will be at output/ directory
  7. To visualize, go back to the main directory: cd ../
  8. Execute: python3 utils/display_samples.py
  9. The outputs will be stores in build/output/output_images/ directory
  10. If you want to make an animation, run: python3 utils/visualize.py and it will save the animation for you in build/output/output_animation/ directory

Blog

Find more about DCGAN on my blogs here:

  1. https://krshrimali.github.io/DCGAN-using-PyTorch-CPP/
  2. https://krshrimali.github.io/DCGAN-using-PyTorch-CPP-Part-2/

Results

This is the output from random noise (batch of) images after ~10 epochs of training:

Happy learning!

TODOs

  1. https://github.com/BuffetCodes/DCGAN-CelebA-PyTorch-CPP/issues/9
  2. https://github.com/BuffetCodes/DCGAN-CelebA-PyTorch-CPP/issues/8
  3. https://github.com/BuffetCodes/DCGAN-CelebA-PyTorch-CPP/issues/6

Contribution

Note: We believe, contributing to an open source project is the best way to learn. To help others learn, we decided to add open source label to the issues we think can be resolved by others. This will benefit us both.

If you are eager to contribute to this project, pick up an issue with open source label. Before you start working on it, make sure you create an issue and cc to any of the main contributors (@krshrimali / @HimanshuSinghGH), and let us know that you are interested. We do not want to waste your efforts in case someone else is already working on it. Thank you!

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