Skip to content

explainingai-code/DCGAN-Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCGAN Implementation in PyTorch

This repository implements training and inference methods of DCGAN on mnist as well as celeb faces dataset

Paper
Video on DCGAN

Sample Output after training on MNIST

Sample Output after training on CelebFaces Dataset

Data preparation

For setting up the mnist dataset: Follow - https://github.com/explainingai-code/Pytorch-VAE#data-preparation

The directory structure should look like this

$REPO_ROOT
    -> data
        -> train
            -> images
                -> 0
                    *.png
                -> 1
                ...
                -> 9
                    *.png
        -> test
            -> images
                -> 0
                    *.png
                ...
    -> dataset
    -> tools
        

For setting up the celeb dataset:

  • Simple Download the images from here -> Downloads -> Align&Cropped Images
  • Download the img_align_celeba.zip file from drive link
  • Extract it under the root directory of the repo
  • $REPO_ROOT -> img_align_celeba/*.jpg files

Quickstart

  • Create a new conda environment with python 3.8 then run below commands
  • git clone https://github.com/explainingai-code/DCGAN-Pytorch.git
  • cd DCGAN-Pytorch
  • pip install -r requirements.txt
  • python -m tools.train --config config/mnist.yaml for training and saving inference samples on mnist

Configuration

  • config/mnist.yaml - For mnist
  • config/mnist_colored.yaml - For mnist colored images
  • config/celeb.yaml - For training on celeb dataset

Output

Outputs will be saved according to the configuration present in yaml files.

For every run a folder of task_name key in config will be created

  • Best Model checkpoints(discriminator and generator) in task_name directory
  • Generated samples saved in task_name/samples

About

This repo implements DCGAN model and trains it on MNIST and Celeb Faces dataset

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published