This project performs face re-aging using a pretrained U-Net model. Given a face image and the person’s current and target ages, it generates an aged or rejuvenated version of the same face.
- Predicts how a person might look older or younger
- Simple CLI interface
- Powered by a pretrained convolutional neural network (U-Net)
git clone https://github.com/christalphilip/transform-age.git
cd transform-agepip install -r requirements.txtThe model file best_unet_model.pth is not included in this repo due to size.
Download it from Hugging Face: ➡️ https://huggingface.co/timroelofs123/face_re-aging
Place it in the model/ folder:
mkdir -p model
# Manually move or use wget if direct link is availablepython scripts/transform_age.pyYou will be prompted to enter:
- The path to your image file (e.g., image.jpg)
- The current age of the person
- The target age to transform to
- The aged image will be saved as aged_output.png.
transform-age/ ├── assets/ # Example images, gifs, small media files ├── lICENSE ├── model/ # Model architecture and code (weights excluded) │ ├── best_unet_model.pth (excluded from repo, users download separately) │ ├── losses.py │ └── models.py ├── notebooks/ # Jupyter notebooks for demos │ └── gradio_demos.ipynb ├── README.md ├── requirements.txt ├── scripts/ # Main scripts including utilities │ ├── transform_age.py │ ├── gradio_demo.py │ └── test_functions.py ├── utils/ # Helper modules │ └── dataloader.py └── .gitignore
- Tim Roelofs on Hugging Face (https://huggingface.co/timroelofs123/face_re-aging) for the pretrained model and original repo.
- U-Net architecture originally proposed in Ronneberger et al., 2015 for biomedical image segmentation.
This project is licensed under the MIT License.
