EdgeFace ONNX
April 4, 2026 · View on GitHub
Tip
The models and functionality in this repository are integrated into UniFace — an all-in-one face analysis toolkit.
ONNX Runtime inference for EdgeFace face recognition. Uses UniFace for face detection and alignment.
Models
ONNX weights exported from official PyTorch weights. Download via bash download.sh or from Releases.
| Model | LFW(%) | CALFW(%) | CPLFW(%) | CFP-FP(%) | AgeDB30(%) | Size | Download |
|---|---|---|---|---|---|---|---|
| EdgeFace-XXS | 99.57 | 94.83 | 90.27 | 93.63 | 94.92 | 4.9 MB | Link |
| EdgeFace-XS (γ=0.6) | 99.73 | 95.28 | 91.58 | 94.71 | 96.08 | 6.9 MB | Link |
| EdgeFace-S (γ=0.5) | 99.78 | 95.55 | 92.48 | 95.74 | 97.03 | 14 MB | Link |
| EdgeFace-Base | 99.83 | 96.07 | 93.75 | 97.01 | 97.60 | 70 MB | Link |
Installation
pip install -r requirements.txt
bash download.sh # Download model weights
Demo
Aligned Faces (112x112)
| Einstein | Einstein | Marie Curie |
|---|---|---|
![]() | ![]() | ![]() |
Similarity Matrix
| p1 | p2 | p3 | |
|---|---|---|---|
| p1 | 1.00 | 0.55 | 0.02 |
| p2 | 0.55 | 1.00 | 0.07 |
| p3 | 0.02 | 0.07 | 1.00 |
p1 and p2 are the same person (similarity: 0.55), p3 is different.
Usage
CLI
python main.py assets/samples/einstein1.jpg assets/samples/einstein2.jpg
Python API
import cv2
from model import EdgeFace
from uniface import compute_similarity
from uniface.detection import SCRFD
detector = SCRFD()
recognizer = EdgeFace("weights/edgeface_xxs.onnx")
image = cv2.imread("image.jpg")
faces = detector.detect(image)
embedding = recognizer.get_normalized_embedding(image, faces[0].landmarks)
similarity = compute_similarity(emb1, emb2, normalized=True)
Reference
License
MIT License


