Implementation BEGAN(Boundary Equilibrium Generative Adversarial Networks) by Keras.
Developed by these software versions.
- Mac OS Sierra: 10.12.4
- Python: 3.5.3
- Keras: 2.0.3
- Theano: 0.9.0
- Pillow: 4.1.0
pip install -r requirements.txt
You can use any square images. For example,
images in http://vis-www.cs.umass.edu/lfw/
[new] All images aligned with deep funneling
(111MB, md5sum 68331da3eb755a505a502b5aacb3c201)
For convert
command, install imagemagick.
brew install imagemagick
ORIGINAL_IMAGE_DIR
: dir of original JPG imagesTARGET_DIR
: dir of after converted images
ORIGINAL_IMAGE_DIR=PATH/TO/ORIGINAL/IMAGE_DIR
CONVERTED_DIR=PATH/TO/CONVERTED/IMAGE_DIR
mkdir -p "$CONVERTED_DIR"
for f in $(find "$ORIGINAL_IMAGE_DIR" -name '*.jpg')
do
echo "$f"
convert "$f" -resize 64x64 ${CONVERTED_DIR}/$(basename $f)
done
PYTHONPATH=src python src/began/create_dataset.py "$CONVERTED_DIR"
PYTHONPATH=src python src/began/training.py
Images are generated in each epoch into generated/epXXX/
directory.
About 680 sec/epoch
-
Linux
-
Dataset:
All images aligned with deep funneling
(13194 samples) -
Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
-
GeForce GTX 1080
-
Environment Variables
KERAS_BACKEND=theano THEANO_FLAGS=device=gpu,floatX=float32,lib.cnmem=1.0
PYTHONPATH=src python src/began/generate_image.py
Generated images are outputted in generated/main/
directory.
Epoch 1 | |||||
---|---|---|---|---|---|
Epoch 25 | |||||
Epoch 50 | |||||
Epoch 75 | |||||
Epoch 100 | |||||
Epoch 125 | |||||
Epoch 150 | |||||
Epoch 175 | |||||
Epoch 200 | |||||
Epoch 215 |
more filters or layers?
Theano 0.9.0 CPU mode on Linux seems to have memory leak problem. See: keras-team/keras#5935