Giter Site home page Giter Site logo

wgan-pytorch's Introduction

WGAN-pytorch

This repo is a pytorch implementation of Wasserstein GAN (WGAN) on celbA dataset

GANs, also known as Generative Adversarial Networks, are one of the most fascinating new developments in deep learning. Yann LeCun saw GANs as "the most fascinating idea in the last 10 years in ML" when Ian Goodfellow and Yoshua Bengio from the University of Montreal first unveiled them in 2014. GANS are frequently used to make deep fake films, improve the quality of images, face swap, design gaming characters, and much more.

The Wasserstein Generative Adversarial Network, or Wasserstein GAN, is an extension to the generative adversarial network that both improves the stability when training the model and provides a loss function that correlates with the quality of generated images. The development of the WGAN has a dense mathematical motivation, although in practice requires only a few minor modifications to the established standard deep convolutional generative adversarial network, or DCGAN. more info from here

Setup and Generate

This code is developed under following library dependencies

python 3.8
torch 1.12.0
torchvision 0.13.0

Start with creating a virtual environment then open your terminal and follow the following steps:

git clone "https://github.com/zaghlol94/WGAN-pytorch"
cd WGAN-pytorch
pip install -r requirements.txt
bash download_assets.sh
cd src
python generate.py

Dataset and Train

Dataset

CelebFaces Attributes Dataset (CelebA) is a large-scale face attributes dataset with more than 200K celebrity images.

└── src
    └── celeb_dataset
        └── images
            ├── 000001.jpg
            ├── 000002.jpg
            ├── 000003.jpg
            ├── .
            ├── .
            ├── .
            ├── .                        
            └── 200000.jpg

Training

Download celabA dataset and add the images' folder in src/celb_dataset if you rename the root folder of the dataset don't forget to change the training_root_folder variable in config.py

cd src
python train.py

after training, you could see the results of fake images in every step in tensorboard

tensorboard --logdir=logs/ 

Results

Results after 5 epochs:

Fake

Real

Citation

@misc{https://doi.org/10.48550/arxiv.1701.07875,
  doi = {10.48550/ARXIV.1701.07875},
  
  url = {https://arxiv.org/abs/1701.07875},
  
  author = {Arjovsky, Martin and Chintala, Soumith and Bottou, Léon},
  
  keywords = {Machine Learning (stat.ML), Machine Learning (cs.LG), FOS: Computer and information sciences, FOS: Computer and information sciences},
  
  title = {Wasserstein GAN},
  
  publisher = {arXiv},
  
  year = {2017},
  
  copyright = {arXiv.org perpetual, non-exclusive license}
}

}

wgan-pytorch's People

Contributors

zaghlol94 avatar

Watchers

James Cloos avatar  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.