CV / ArcFace
ArcFace MobileFaceNet
reComputer R Series (CM5 + Hailo-10H)
ArcFace face recognition (2.04M params, 99.4% LFW) on reComputer R Series with Hailo-8 or Hailo-10H.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm \
--name cm5-hailo-arcface \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
-v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo10h-cv/arcface_mobilefacenet:latest \
python web_detection.py --model_path model/arcface_mobilefacenet.hef --video_path video/test.mp4REST API
Use the REST API to run inference. Copy the commands below.
curl -X POST "http://<Board_IP>:8000/api/models/arcface_mobilefacenet/predict" \
-F "file=@face.jpg"import requests
resp = requests.post(
"http://<Board_IP>:8000/api/models/arcface_mobilefacenet/predict",
files={"file": open("face.jpg", "rb")},
timeout=30,
)
print(resp.json())Model Details
reComputer R Series (CM5 + Hailo-10H)ArcFace MobileFaceNet on reComputer R Series (CM5 + Hailo-10H)
ArcFace with a MobileFaceNet backbone extracts 512-dim face embeddings on Hailo-10H through HailoRT. The embedding is used for face verification and identification; face comparison itself is done by the client with cosine similarity.
This page targets reComputer R Series (CM5 + Hailo-10H) with a PCIe Hailo-10H accelerator.
Model Info
| Property | Value |
|---|---|
| Architecture | ArcFace with MobileFaceNet backbone |
| Task | Face recognition (embedding extraction) |
| Input | 112x112x3 RGB (letterboxed, normalization compiled into the HEF) |
| Output | 512-dim face embedding |
| Parameters | 2.04M |
| LFW accuracy | 99.4% (Hailo Model Zoo reference) |
| HEF | Hailo Model Zoo v5.4.0, Hailo-10H |
The accuracy value is Hailo's Model Zoo reference. It is not a benchmark measured on CM5.
Hardware and Host Setup
| Item | Value |
|---|---|
| Board | reComputer R Series with Raspberry Pi CM5 |
| Accelerator | Hailo-10H over PCIe, exposed as /dev/hailo0 |
| Runtime | HailoRT 5.1.1 |
| Python in container | 3.13, aarch64 |
Install the Hailo-10H packages on the host and confirm that the driver and device are ready before starting the container:
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot
# After reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0Run With Demo Video
sudo docker run --rm \
--name cm5-hailo-arcface \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
-v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo10h-cv/arcface_mobilefacenet:latest \
python web_detection.py --model_path model/arcface_mobilefacenet.hef --video_path video/test.mp4Open http://<Board_IP>:8000 to view the web preview. Each frame is annotated
with the embedding dimension, and the REST API returns the full 512-dim vector.
USB Camera Mode
sudo docker run --rm \
--name cm5-hailo-arcface \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
--device /dev/video0:/dev/video0 \
-v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
-v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
ghcr.io/seeed-projects/recomputer-hailo10h-cv/arcface_mobilefacenet:latest \
python web_detection.py --model_path model/arcface_mobilefacenet.hef --camera_id 0REST API
Prediction endpoint:
POST http://<Board_IP>:8000/api/models/arcface_mobilefacenet/predictcurl -X POST "http://<Board_IP>:8000/api/models/arcface_mobilefacenet/predict" \
-F "file=@face.jpg"{
"success": true,
"source": "uploaded image",
"embedding": [0.023, -0.156, 0.089, "..."],
"dimension": 512,
"image": { "width": 1280, "height": 720 }
}| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/arcface_mobilefacenet/predict | POST | Face embedding (JSON) |
/api/video_feed | GET | MJPEG preview stream |
/api/video/upload | POST | Upload a source video |
/api/video/analyze | POST | Start offline video analysis |
/api/video/status | GET | Read analysis progress |
/api/video/download/{filename} | GET | Download the annotated result |
Face verification is not exposed as a separate endpoint: compare two returned embeddings with cosine similarity on the client side (L2-normalize both vectors first).
HEF Files
| HEF | Size | Notes |
|---|---|---|
arcface_mobilefacenet.hef | 2,666,496 bytes | Hailo-10H build, Model Zoo v5.4.0 |
Implementation Notes
- The HEF contains its own normalization layer, so the application letterboxes frames to 112x112, converts BGR to RGB, and feeds raw uint8 pixels.
- The embedding is read from the
fc1output when the vstream name is exposed; otherwise the first output tensor is used. The first inference logs every vstream name and shape so the mapping can be verified on hardware. - Empty or non-finite embeddings are rejected instead of being returned as a valid result.
Development Notes
- Source module:
src/hailo10h_arcface_mobilefacenet/ - Dockerfile:
docker/hailo10h/arcface_mobilefacenet.dockerfile - Container:
ghcr.io/seeed-projects/recomputer-hailo10h-cv/arcface_mobilefacenet:latest - The module uses the HailoRT 5.1.1 InferModel API and a Hailo-10H-specific HEF.
Inputs and Outputs
Input: image (112x112 RGB). Output: 512-dim face embedding vector.