Add model card
Browse files
README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- face-generation
|
| 5 |
+
- flow-matching
|
| 6 |
+
- arc2face
|
| 7 |
+
- synthetic-data
|
| 8 |
+
- fairness
|
| 9 |
---
|
| 10 |
+
|
| 11 |
+
# ID-Flow
|
| 12 |
+
|
| 13 |
+
Pretrained **ID-Flow** weights from [**SynthFaces: Balanced Large Scale Human Dataset**](https://arxiv.org/abs/2610.40119v1)
|
| 14 |
+
(accepted to BMVC 2026).
|
| 15 |
+
|
| 16 |
+
ID-Flow is a label-conditional geodesic flow-matching model on the unit hypersphere of ArcFace identity embeddings
|
| 17 |
+
(~11.8M parameters). Given an (age, race, gender) combination it samples a new identity embedding, which
|
| 18 |
+
[Arc2Face](https://github.com/foivospar/Arc2Face) turns into face images. Sampling all 126 label combinations uniformly
|
| 19 |
+
gives a demographically balanced set of synthetic identities.
|
| 20 |
+
|
| 21 |
+
- Code: [github.com/ControlGenAI/SynthFaces](https://github.com/ControlGenAI/SynthFaces) (to be released)
|
| 22 |
+
- Paper: [arXiv:2610.40119](https://arxiv.org/abs/2610.40119v1)
|
| 23 |
+
|
| 24 |
+
## Files
|
| 25 |
+
|
| 26 |
+
| file | description |
|
| 27 |
+
|---|---|
|
| 28 |
+
| `idflow.pt` | weights-only, self-describing checkpoint (model weights + hyper-parameters), 47 MB |
|
| 29 |
+
|
| 30 |
+
Label order is `[age, race, gender]`: age `0-2, 3-9, 10-19, 20-29, 30-39, 40-49, 50-59, 60-69, 70+`; race
|
| 31 |
+
`White, Black, Latino_Hispanic, East Asian, Southeast Asian, Indian, Middle Eastern`; gender `Male, Female`.
|
| 32 |
+
|
| 33 |
+
## Usage: ID-Flow → Arc2Face
|
| 34 |
+
|
| 35 |
+
Setup (from the code repository):
|
| 36 |
+
|
| 37 |
+
```bash
|
| 38 |
+
git clone https://github.com/ControlGenAI/SynthFaces && cd SynthFaces
|
| 39 |
+
pip install -r requirements.txt
|
| 40 |
+
huggingface-cli download shredder67/id-flow idflow.pt --local-dir .
|
| 41 |
+
python scripts/download_arc2face.py --root Arc2Face # Arc2Face + InsightFace models
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
Sample a balanced set of identities (all 126 label groups), then generate images with Arc2Face:
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
python scripts/sample_identities.py --ckpt idflow.pt --n_total 1000 --output_dir outputs/identities
|
| 48 |
+
|
| 49 |
+
python scripts/sample_images.py sample \
|
| 50 |
+
--embeddings_path outputs/identities/id_embeddings.pt \
|
| 51 |
+
--output_dir outputs/images --images_per_identity 4
|
| 52 |
+
python scripts/sample_images.py merge --output_dir outputs/images --n_parts 1
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
Or sample identity embeddings for chosen labels directly in Python:
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
import torch
|
| 59 |
+
from idflow import load_idflow
|
| 60 |
+
|
| 61 |
+
model = load_idflow("idflow.pt", device="cuda:0")
|
| 62 |
+
y = torch.tensor([[3, 0, 1]] * 16, device="cuda:0") # age 20-29, White, Female
|
| 63 |
+
ids = model.sample(bs=16, y=y, guidance_scale=2.0, device="cuda:0") # (16, 512) unit-norm ArcFace embeddings
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
The embeddings can be passed to Arc2Face as `id_embeddings.pt` (see `scripts/sample_images.py`). A guidance scale of
|
| 67 |
+
2.0 is used in the paper; higher values follow the labels more closely at the cost of diversity.
|
| 68 |
+
|
| 69 |
+
## Notes
|
| 70 |
+
|
| 71 |
+
The Arc2Face, InsightFace and Stable Diffusion 1.5 weights used for image generation are distributed under their own
|
| 72 |
+
licenses (the Arc2Face and InsightFace weights are non-commercial); please check them before use.
|
| 73 |
+
|
| 74 |
+
## Citation
|
| 75 |
+
|
| 76 |
+
```bibtex
|
| 77 |
+
@article{karpukhin2026synthfaces,
|
| 78 |
+
title = {SynthFaces: Balanced Large Scale Human Dataset},
|
| 79 |
+
author = {Karpukhin, Sergey and Bobkov, Denis and Morozov, Kirill and Alanov, Aibek},
|
| 80 |
+
journal = {arXiv preprint arXiv:2610.40119},
|
| 81 |
+
year = {2026},
|
| 82 |
+
note = {Accepted to BMVC 2026}
|
| 83 |
+
}
|
| 84 |
+
```
|