This is the official PyTorch implementation of "[NeurIPS 2024] TopoFR: A Closer Look at Topology Alignment on Face Recognition".
pip install -r requirement.txt
You can download the training datasets, including MS1MV2 and Glint360K:
You can download the test dataset IJB-C as follows:
You need to modify the path of training dataset in every configuration file in folder configs.
To run on a machine with 4 GPUs:
python -m torch.distributed.launch --nproc_per_node=4 --nnodes=1 --node_rank=0 --master_addr="127.0.0.1" --master_port=12581 train.py
You need to modify the path of IJB-C dataset in eval_ijbc_ms1mv2.py and eval_ijbc_glint360k.py.
Run:
python eval_ijbc_ms1mv2.py --model-prefix work_dirs/ms1mv2_r50/model.pt --result-dir work_dirs/ms1mv2_r50 --network r50 > ijbc_ms1mv2_R50_TopoFR.log 2>&1 &
python eval_ijbc_glint360k.py --model-prefix work_dirs/glint360k_r50/model.pt --result-dir work_dirs/glint360k_r50 --network r50 > ijbc_glint360k_R50_TopoFR.log 2>&1 &
Verification accuracy (%) on IJB-C benchmark. † denotes TopoFR trained by CosFace. | Training Data | Model | IJB-C(1e-5) | IJB-C(1e-4) |
---|---|---|---|---|
MS1MV2 | R50 TopoFR† | 94.79 | 96.42 | |
MS1MV2 | R50 TopoFR | 94.71 | 96.49 | |
MS1MV2 | R100 TopoFR† | 95.28 | 96.96 | |
MS1MV2 | R100 TopoFR | 95.23 | 96.95 | |
MS1MV2 | R200 TopoFR† | 95.19 | 97.12 | |
MS1MV2 | R200 TopoFR | 95.15 | 97.08 |
Training Data | Model | IJB-C(1e-5) | IJB-C(1e-4) |
---|---|---|---|
Glint360K | R50 TopoFR | 95.99 | 97.27 |
Glint360K | R100 TopoFR | 96.57 | 97.60 |
Glint360K | R200 TopoFR | 96.71 | 97.84 |
python eval_ijbc_glint360k.py --model-prefix work_dirs/glint360k_r100/Glint360K_R100_TopoFR_9760.pt --result-dir work_dirs/glint360k_r100 --network r100 > ijbc_glint360k_R100_TopoFR.log 2>&1 &
@article{dan2024topofr,
title={TopoFR: A Closer Look at Topology Alignment on Face Recognition},
author={Dan, Jun and Liu, Yang and Deng, Jiankang and Xie, Haoyu and Li, Siyuan and Sun, Baigui and Luo, Shan},
journal={arXiv preprint arXiv:2410.10587},
year={2024}
}
We thank Insighface for the excellent code base.