CV / 人脸关键点

Face Landmarks Lite(人脸关键点轻量模型)

reComputer R Series (CM5 + Hailo-10H)

在搭载 Hailo-10H 的 reComputer CM5 上运行 MediaPipe Face Landmarks Lite(0.6M 参数,972 FPS)。

78 次下载
大小
1.8 MB
内存
4GB+
精度
Hailo HEF / HailoRT

选择你正在使用的设备,设置指南和文档将相应更新。

快速开始

部署
sudo docker run --rm \
  --name pi5-hailo-face-landmarks \
  --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/face_landmarks_lite:latest \
  python web_detection.py --model_path model/face_landmarks_lite.hef --video_path video/test.mp4

REST API

使用 REST API 进行推理。复制以下命令。

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

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

模型详情

Face Landmarks Lite 在 reComputer R Series(CM5 + Hailo-10H)上运行

MediaPipe Face Landmarks Lite(0.6M 参数,972 FPS)用于人脸关键点检测,通过 HailoRT 在 Hailo-10H 上运行。

模型信息

属性值
架构MediaPipe Face Landmarks
任务人脸关键点检测
输入192×192×3 RGB
输出98 个人脸关键点
参数量0.6M
FPS972
来源Hailo Model Zoo

硬件与主机设置

项目值
开发板Raspberry CM5
加速器Hailo-10H, /dev/hailo0
操作系统Raspberry Pi OS Bookworm, aarch64
bash
sudo apt update && sudo apt install hailo-h10-all -y
sudo reboot

hailortcli fw-control identify
ls /dev/hailo0

使用演示视频运行

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/face_landmarks_lite:latest \
  python web_detection.py --model_path model/face_landmarks_lite.hef --video_path video/test.mp4

USB 摄像头模式

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/face_landmarks_lite:latest \
  python web_detection.py --model_path model/face_landmarks_lite.hef --camera_id 0

HEF 文件

HEF大小备注
face_landmarks_lite.hef1.8 MB人脸关键点检测

REST API

text
POST http://<Board_IP>:8000/api/models/face_landmarks_lite/predict
bash
curl -X POST "http://<Board_IP>:8000/api/models/face_landmarks_lite/predict" \
  -F "file=@test.jpg"
端点方法用途
/GET网页预览界面
/api/models/face_landmarks_lite/predictPOST98 个关键点(JSON)
/api/video_feedGETMJPEG 预览流

开发

  • 来源: src/hailo10h_face_landmarks_lite/
  • Dockerfile: docker/hailo10h/face_landmarks_lite.dockerfile

输入与输出

输入:图像(192x192 RGB)。输出:98 个面部关键点及置信度。