Downloads · 30 days
0
globalnebula/adaface-ir50-ms1mv2-onnx
adaface-ir50-ms1mv2-onnx is a image feature extraction model from globalnebula. Use it for the image feature extraction task on the model card, and read the license before you ship it in a product. It is set up for onnxruntime. The card lists the license as other.
ONNX export of the AdaFace IR-50 face-recognition backbone trained on MS1MV2. Produces a 512-dimensional face embedding for verification / identification. Runs on onnxruntime (CPU or CUDA) with no PyTorch dependency a…
Downloads · 30 days
0
Access
Public
Updated Aug 20, 2026
Repo size
174 MB
Likes
0
Public
Click a slice to open those files.
.onnx174 MB · 100%
From the Hugging Face model README
ONNX export of the AdaFace IR-50 face-recognition backbone trained on
MS1MV2. Produces a 512-dimensional face embedding for verification /
identification. Runs on onnxruntime (CPU or CUDA) with no PyTorch dependency
at inference time.
This is a straight conversion of the published PyTorch checkpoint — the weights
are unchanged. It exists because AdaFace ships only as a PyTorch .ckpt and
this project's inference worker runs on onnxruntime.
| Name | Shape | Notes | |
|---|---|---|---|
| Input | input | (batch, 3, 112, 112) | ArcFace-aligned BGR face, normalized (x - 127.5) / 127.5 |
| Output | embedding | (batch, 512) | Face feature; L2-normalize before cosine comparison |
FaceRecognizerSF.alignCrop), keep channels in BGR,
then scale with (x - 127.5) / 127.5.import cv2, numpy as np, onnxruntime as ort
sess = ort.InferenceSession("adaface_ir50_ms1mv2.onnx", providers=["CPUExecutionProvider"])
def embed(aligned_bgr_112: np.ndarray) -> np.ndarray:
x = (aligned_bgr_112.astype(np.float32) - 127.5) / 127.5 # (112,112,3) BGR
x = np.transpose(x, (2, 0, 1))[None] # (1,3,112,112)
e = sess.run(["embedding"], {"input": x})[0][0] # (512,)
return e / np.linalg.norm(e)
# cosine similarity
# sim = float(embed(face_a) @ embed(face_b))
The export was checked against the source PyTorch model on identical inputs:
onnx.checker passes.(1, 512); embedding L2 norm ≈ 1.0.@inproceedings{kim2022adaface,
title = {AdaFace: Quality Adaptive Margin for Face Recognition},
author = {Kim, Minchul and Jain, Anil K. and Liu, Xiaoming},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2022}
}