Skip to content

Face re-aging with a pretrained U-Net model. Transform face images to appear older or younger using a simple Python CLI.

License

Notifications You must be signed in to change notification settings

christalphilip/transform-age

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Aging with Pretrained UNet

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.

example

Features

  • Predicts how a person might look older or younger
  • Simple CLI interface
  • Powered by a pretrained convolutional neural network (U-Net)

Getting Started

1. Clone the repository

git clone https://github.com/christalphilip/transform-age.git
cd transform-age

2. Install dependencies

pip install -r requirements.txt

3. Download the pretrained model

The 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 available

Usage

python scripts/transform_age.py

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

Project Structure

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

Acknowledgements

License

This project is licensed under the MIT License.

About

Face re-aging with a pretrained U-Net model. Transform face images to appear older or younger using a simple Python CLI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published