2025/03/13
: Face Detection added in onnx_inference.py
.2025/03/13
: ONNX Export and Inference has been added.2025/01/03
: We released the Face-Recognition training framework and pretrained model weights.Dataset | Backbone | LFW (%) | CALFW (%) | CPLFW (%) | AgeDB_30 (%) | Num Params |
---|---|---|---|---|---|---|
MS1MV2 | Sphere20 | 99.67 | 95.61 | 88.75 | 96.58 | 24.5M |
MS1MV2 | Sphere36 | 99.72 | 95.64 | 89.92 | 96.83 | 34.6M |
MS1MV2 | MobileNetV1_0.25 | 98.76 | 92.02 | 82.37 | 90.02 | 0.36M |
MS1MV2 | MobileNetV2 | 99.55 | 94.87 | 86.89 | 95.16 | 2.29M |
MS1MV2 | MobileNetV3_Small | 99.30 | 93.77 | 85.29 | 92.79 | 1.25M |
MS1MV2 | MobileNetV3_Large | 99.53 | 94.56 | 86.79 | 95.13 | 3.52M |
Date | Feature Description |
---|---|
2024-12-15 | ๐ Training Pipeline: Introduced a simple and effective pipeline for face-recognition training with support for DDP and single GPU configurations. |
2024-12-15 | ๐ Pretrained Models: Added support for MobileNetV1/V2/V3 , Sphere20 , and Sphere36 models for versatile use-cases and performance tiers. |
2024-12-15 | ๐ Dataset Downloads: Easy access to aligned and cropped training and validation datasets via Kaggle links. |
2024-12-15 | ๐ง Modular Codebase: Fully modular and reproducible codebase for easier customization and extension. |
2024-12-15 | ๐ Dataset Compatibility: Supports CASIA-WebFace , VGGFace2 , and MS1MV2 datasets, pre-aligned and cropped for streamlined training. |
git clone https://github.com/yakhyo/face-recognition.git
cd face-recognition
pip install -r requirements.txt
Codebase supports DDP, to run using DDP please use below example command:
torchrun --nproc_per_node=2 train.py --root data/train/ms1m_112x112 --database MS1M --network mobilenetv1 --classifier MCP
If you have a single GPU then use the below example command:
python train.py --root data/train/ms1m_112x112 --database MS1M --network mobilenetv1 --classifier MCP
To evaluate, please modify model, weights, and validation data filenames in evaluate.py
python evaluate.py
The following pretrained model weights are available for download under the release v0.0.1:
Model | Download Link |
---|---|
MobileNetV1_0.25 | Download |
MobileNetV2 | Download |
MobileNetV3_Small | Download |
MobileNetV3_Large | Download |
Sphere20 | Download |
Sphere36 | Download |
weights/
).Run following command to export to ONNX:
python -m scripts.onnx_export -w [path/to/weight/file] -n [network/architecture/name] --dynamic[Optional]
Run onnx_inference.py
to use ONNXRuntime. This inference calculates the similarity between two face images.
python onnx_inference.py
Run inference.py
for PyTorch model inference. This inference calculates the similarity between two face images.
You can download aligned and cropped (112x112) training and validation datasets from Kaggle.
opensphere
opensphere
insightface
Validation data contains AgeDB_30, CALFW, CPLFW, and LFW datasets.
data/
|-- train/
| |-- ms1m_112x112/
| |-- vggface2_112x112/
| |-- webface_112x112/
|-- val/
| |-- agedb_30_112x112/
| |-- calfw_112x112/
| |-- cplfw_112x112/
| |-- lfw_112x112/
| |-- agedb_30_ann.txt
| |-- calfw_ann.txt
| |-- cplfw_ann.txt
| |-- lfw_ann.txt
This project is licensed under the MIT License. See the LICENSE file for details.