TensorFlow implementation of the algorithm in the paper Age Progression/Regression by Conditional Adversarial Autoencoder.
- FGNET
- MORPH
- CACD
- UTKFace (Access from the Github link or the Wiki link)
$ python main.py
--dataset default 'UTKFace'. Please put your own dataset in ./data
--savedir default 'save'. Please use a meaningful name, e.g., save_init_model.
--epoch default 50.
--use_trained_model default True. If use a trained model, savedir specifies the model name.
--use_init_model default True. If load the trained model failed, use the init model save in ./init_model
$ python main.py --is_train False --testdir your_image_dir --savedir save
Note: savedir
specifies the model name saved in the training. By default, the trained model is saved in the folder save (i.e., the model name).
Then, it is supposed to print out the following message.
Building graph ...
Testing Mode
Loading pre-trained model ...
SUCCESS ^_^
Done! Results are saved as save/test/test_as_xxx.png
Specifically, the testing faces will be processed twice, being considered as male and female, respectively. Therefore, the saved files are named test_as_male.png
and test_as_female.png
, respectively. To achieve better results, it is necessary to train on a large and diverse dataset.
FaceAging.py
is a class that builds and initializes the model, and implements training and testing related stuffops.py
consists of functions calledFaceAging.py
to implement options of convolution, deconvolution, fully connection, leaky ReLU, load and save images.main.py
demonstratesFaceAging.py
.