Tensorflow implementation of AttGAN - Arbitrary Facial Attribute Editing: Only Change What You Want
Exemplar Results
-
Inverting 13 attributes respectively (From left to right: Input, Reconstruction, Bald, Bangs, Black_Hair, Blond_Hair, Brown_Hair, Bushy_Eyebrows, Eyeglasses, Male, Mouth_Slightly_Open, Mustache, No_Beard, Pale_Skin, Young)
-
Comparisons with VAE/GAN and IcGAN on inverting single attribute
-
Comparisons with VAE/GAN and IcGAN on simultaneously inverting multiple attributes
Usage
-
Prerequisites
- tensorflow 1.7 or 1.8
- python 2.7 or 3.6
-
Celeba dataset
- Images should be placed in ./data/img_align_celeba/*.jpg
- Attribute labels should be placed in ./data/list_attr_celeba.txt
-
Example of training
-
training
CUDA_VISIBLE_DEVICES=0 python train.py --img_size 128 --shortcut_layers 1 --inject_layers 1 --experiment_name 128_shortcut1_inject1_none
-
tensorboard for loss visualization
CUDA_VISIBLE_DEVICES='' tensorboard --logdir ./output/128_shortcut1_inject1_none/summaries --port 6006
-
-
Example of testing single attribute
CUDA_VISIBLE_DEVICES=0 python test.py --experiment_name 128_shortcut1_inject1_none --test_int 1.0
-
Example of testing multiple attributes
CUDA_VISIBLE_DEVICES=0 python test_multi.py --experiment_name 128_shortcut1_inject1_none --test_atts Pale_Skin Male --test_ints 0.5 0.5
-
Example of attribute intensity control
CUDA_VISIBLE_DEVICES=0 python test_slide.py --experiment_name 128_shortcut1_inject1_none --test_att Male --test_int_min -1.0 --test_int_max 1.0 --n_slide 10
Citation
If you find AttGAN useful in your research work, please consider citing:
@article{he2017arbitrary,
title={Arbitrary Facial Attribute Editing: Only Change What You Want},
author={He, Zhenliang and Zuo, Wangmeng and Kan, Meina and Shan, Shiguang and Chen, Xilin},
journal={arXiv preprint arXiv:1711.10678},
year={2017}
}