Skip to content

Implementation of the paper, "PFA-GAN: Progressive Face Aging with Generative Adversarial Network", IEEE 2021 by Huang et al

Notifications You must be signed in to change notification settings

garg-abhinav/PFA_GAN

Repository files navigation

PFA-GAN Implementation

CS543 Computer Vision | Fall 2021 | UIUC

Pytorch implementation of PFA-GAN: Progressive Face Aging with Generative Adversarial Network (paper).

Contributors

  1. Abhinav Garg ([email protected])
  2. Parth Gera ([email protected])

Install dependencies

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

Train

1. Prepare data

CACD2000 Dataset

  1. Download the dataset (data).

  2. Create a directory named data and extract all the files there.

  3. Create the metadata files (train and test) for training the network using data_exploration.py. Update the file as needed.

  4. 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
  5. Modify the paths accordingly in config/config.py.

2. Set Configuration

Update the parameters in config/config.py as per the experiment.

3. Model Training

  1. Train the age estimation network.
python age_estimator_network.py 
  1. Download the DeepFace caffe model (the torch model on this website is buggy).

  2. 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.

  3. Train the GAN.

python pfa_gan_train.py 
  1. Tensorboard file created under the runs directory can be used for monitoring the progress.

Inference

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.

About

Implementation of the paper, "PFA-GAN: Progressive Face Aging with Generative Adversarial Network", IEEE 2021 by Huang et al

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages