Skip to content

Implementation of a basic and universal DCGAN model using Keras

License

Notifications You must be signed in to change notification settings

kcct-fujimotolab/minimum-DCGAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCGAN

Implementation of basic and universal DCGAN model using Keras.

Description

These programs can load images from the specified directory, resize these images and train the Keras model. Images generated during training can be recorded. Also, trained models can be loaded and can be generated images.

Requirements

  • Python 3.0 or newer
  • Keras 2.0 or newer (Tensorflow backend)
  • Pillow
  • numpy
  • tqdm
  • h5py

Getting started

  1. Clone this repository:
git clone https://github.com/kcct-fujimotolab/DCGAN.git
cd DCGAN/
  1. Make a directory for data sets:
mkdir images
  1. Collect images (more than 2000-3000 works better):
ls images/
data0000.jpg   data0001.jpg   ...   data9999.jpg
  1. Start training by specifying image size, number of epochs, data set directory, etc.:
python train.py --input images/ --size 64 64 --epoch 1000
  1. Generate images by specifying output directory, number of batches:
python generate.py --output gen/ --batch 64

Options

--help -h: show information

train.py

--input -i: data sets path (default -i images/)
--size -z: image size during training, 2 values required, must be multiples of 8 (default -z 64 64)
--epoch -e: number of epochs (default -e 3000)
--batch -b: batch size (default -b 64)
--dim -d: input dimension of generator (default -d 100)
--output -o: output directory path (default -o gen/)
--save -s: taking snapshot interval (default -s 100)

generate.py

--output -o: output directory path (default -o gen/)
--batch -b: number of generated images (default -b 64)

Results

We extracted 4096 images from the face data provided by Labeled Faces in the Wild, and trained with Keras model.

1000 epochs

1000

2000 epochs

2000

4000 epochs

4000

6000 epochs

6000

Author

Fujimoto Lab at Kobe City College of Technology
Undergraduate Student of Electronics Department
@yoidea

About

Implementation of a basic and universal DCGAN model using Keras

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages