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())

モデル詳細

reComputer CM5 + Hailo-10H で Face Landmarks Lite を実行

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
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

デモ動画で実行

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"
エンドポイントメソッド用途
/GETWeb プレビュー画面
/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 個の顔特徴点。