CV / LightFace

LightFace Slim

LightFace Slim (Ultra-Light-Fast-Generic-Face-Detector-1MB) performs real-time face detection with bounding boxes through HailoRT inference. 817 FPS, ideal for edge deployment.

2 downloads
Size
616 KB
Memory
4GB+
Precision
Hailo HEF / HailoRT

Choose the device you're using, the set up guide and documentation will update accordingly.

Getting Started

Deploy
sudo docker run --rm \
  --name cm5-hailo-lightface \
  --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/lightface_slim:latest \
  python web_detection.py --model_path model/lightface_slim.hef --video_path video/test.mp4

REST API

Use the REST API to run inference. Copy the commands below.

Curl
curl -X POST "http://<Board_IP>:8000/api/models/lightface_slim/predict" \
  -F "file=@test.jpg"
Python
import requests

resp = requests.post(
    "http://<Board_IP>:8000/api/models/lightface_slim/predict",
    files={"file": open("test.jpg", "rb")},
    timeout=30,
)
print(resp.json())

Model Details

LightFace Slim on reComputer R Series (CM5 + Hailo-10H)

Ultra-lightweight face detection (0.26M params, 817 FPS) running on Hailo-10H via HailoRT.

This page targets reComputer R Series (CM5 + Hailo-10H) with a PCIe Hailo-10H accelerator.

Model Info

PropertyValue
ArchitectureUltra-Light-Fast-Generic-Face-Detector-1MB
TaskFace Detection
Input240×320×3 RGB
OutputFace bounding boxes with confidence
Parameters0.26M
FPS817
SourceHailo Model Zoo

Hardware and Host Setup

ItemValue
BoardreComputer R Series with Raspberry Pi CM5
AcceleratorHailo-10H over PCIe, /dev/hailo0
OSRaspberry Pi OS Bookworm, aarch64
bash
sudo apt update && sudo apt install hailo-h10-all -y
sudo reboot

hailortcli fw-control identify
ls /dev/hailo0

Run With Demo Video

bash
sudo docker run --rm --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/lightface_slim:latest \
  python web_detection.py --model_path model/lightface_slim.hef --video_path video/test.mp4

USB Camera Mode

bash
sudo docker run --rm --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/lightface_slim:latest \
  python web_detection.py --model_path model/lightface_slim.hef --camera_id 0

HEF Files

HEFSizeNotes
lightface_slim.hef616 KBFace detection model

REST API

text
POST http://<Board_IP>:8000/api/models/lightface_slim/predict
bash
curl -X POST "http://<Board_IP>:8000/api/models/lightface_slim/predict" \
  -F "file=@test.jpg"
EndpointMethodPurpose
/GETWeb preview UI
/api/models/lightface_slim/predictPOSTFace boxes (JSON)
/api/video_feedGETMJPEG preview stream

Development

  • Source: src/hailo10h_lightface_slim/
  • Dockerfile: docker/hailo10h/lightface_slim.dockerfile

Inputs and Outputs

Input: image (240x320 RGB). Output: face bounding boxes with confidence scores.