FairFace ONNX
January 1, 2026 · View on GitHub
ONNX Runtime inference for FairFace face attribute prediction model.
Tip
The models and functionality in this repository are integrated into UniFace — an all-in-one face analysis toolkit.
Features
- Race prediction (7 categories)
- Gender prediction (Male/Female)
- Age prediction (9 groups)
- PyTorch and ONNX Runtime support
- Image and webcam inference
Installation
pip install -r requirements.txt
Download
| Model | PyTorch | ONNX |
|---|---|---|
| FairFace | fairface.pt | fairface.onnx |
Usage
Image Inference
# PyTorch
python inference.py --source path/to/image.jpg --output result.jpg
# ONNX
python onnx_inference.py --source path/to/image.jpg --output result.jpg
Webcam
python inference.py --source 0
Export Model
python onnx_export.py --model weights/fairface.pt --output weights/fairface.onnx
License
This project is licensed under the MIT License.
Model weights are from FairFace and licensed under CC BY 4.0.