Pytorch implementation of PFA-GAN: Progressive Face Aging with Generative Adversarial Network (paper).
- Abhinav Garg ([email protected])
- Parth Gera ([email protected])
Here is an example of create environ from scratch with anaconda
# create conda env
conda create --name pfagan python=3.9
conda activate pfagan
# install dependencies
pip install -r requirements.txt
-
Download the dataset (data).
-
Create a directory named
data
and extract all the files there. -
Create the metadata files (train and test) for training the network using
data_exploration.py
. Update the file as needed. -
The directory should have this basic structure
$data/CACD2000 # jpg files goes here $data/celebrity2000_meta.mat # base metadata file $data/image_ages.pkl # age of the person in the image for training $data/image_urls.pkl # training image paths $data/test_image_ages.pkl # age of the person in the image for test $data/test_image_urls.pkl # test image paths
-
Modify the paths accordingly in
config/config.py
.
Update the parameters in config/config.py
as per the experiment.
- Train the age estimation network.
python age_estimator_network.py
-
Download the DeepFace caffe model (the torch model on this website is buggy).
-
Use a caffe-to-pytorch converter to port the DeepFace model to pytorch and place it under the
models
directory. One such converter can be found here. -
Train the GAN.
python pfa_gan_train.py
- Tensorboard file created under the
runs
directory can be used for monitoring the progress.
To run inference on select test images, update the paths where trained models are located in config/config.py
.
python test.py
Use the Face++ API to evaluate the model.