A lightweight GAN for face aging. Given a face photo, the model generates an aged version of the same face.
pip install -r requirements.txt
The pretrained generator weights are included at pretrained_model/state_dict.pth.
Put face images (.jpg / .png) in a folder and run:
python infer.py --image_dir sample_images
This loads the generator, runs each image through it, and saves a before/after grid to mygraph.png.
Configure dataset paths and hyperparameters in configs/aging_gan.yaml, then run:
python main.py
Training uses PyTorch Lightning; see gan_module.py for the GAN training loop and models.py for the generator/discriminator architectures.
infer.py— run inference on a folder of imagesmain.py— train the GANgan_module.py— Lightning module with the training/optimization logicmodels.py— generator and discriminator architecturesdataset.py— dataset loadingpreprocessing/— scripts to preprocess the CACD and UTKFace datasetspretrained_model/— pretrained generator weights