CV / CenterPose

CenterPose RegNetX-800MF

CenterPose RegNetX-800MFによる複数人姿勢推定(17個のCOCOキーポイント)。reComputer Rシリーズ + Hailo-8 / Hailo-10H対応。

15 ダウンロード
サイズ
13.93 MB
メモリ
4GB+
精度
Hailo HEF / HailoRT

使用しているデバイスを選択してください。セットアップガイドとドキュメントがそれに応じて更新されます。

はじめる

デプロイ
sudo docker run --rm \
  --name pi5-hailo8-centerpose \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/centerpose_regnetx_800mf:latest \
  python web_detection.py --model_path model/centerpose_regnetx_800mf.hef --video_path video/test.mp4

REST API

REST API を使用して推論を実行します。以下のコマンドをコピーしてください。

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

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

モデル詳細

reComputer R Series (CM5 + Hailo-8)

CenterPose RegNetX-800MF(reComputer Rシリーズ CM5 + Hailo-8対応)

CenterPose RegNetX-800MFは、1回のネットワーク推論でボトムアップ方式の複数人姿勢推定を行います。Hailo-8デモは人物ボックスと17個のCOCO身体キーポイントを返し、FastAPIサービスを通じてライブMJPEGプレビュー、画像推論、オフライン動画分析を提供します。

モデル情報

項目値
アーキテクチャCenterPose + RegNetX-800MFバックボーン
タスク複数人姿勢推定
入力512×512×3 BGR
出力人物ボックスと17個のCOCOキーポイント
パラメータ数12.31M
HEFソースHailo Model Zoo v2.19.0、Hailo-8向けコンパイル
ランタイムHailoRT 4.23.x

ハードウェアとホストのセットアップ

項目値
ボードRaspberry Pi CM5搭載reComputer Rシリーズ
アクセラレータHailo-8(PCIe接続)、/dev/hailo0として公開
OSRaspberry Pi OS, aarch64
検証済みランタイムHailoRT 4.23.x
bash
sudo apt update
sudo apt install hailort hailort-pcie-driver python3-hailort
sudo reboot

# 再起動後に確認
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0

ドライバ、デバイスファームウェア、ホストのlibhailort.so、コンテナ内のPython wheelは、同じHailoRTメジャー/マイナーバージョンである必要があります。

同梱のデモ動画で実行

動画はご要望どおりyolov8_poseアプリケーションから再利用しています。

bash
sudo docker run --rm \
  --name pi5-hailo8-centerpose \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/centerpose_regnetx_800mf:latest \
  python web_detection.py \
    --model_path model/centerpose_regnetx_800mf.hef \
    --video_path video/test.mp4

http://<Board_IP>:8000を開くと、注釈付きストリームと動画分析UIを確認できます。

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.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/centerpose_regnetx_800mf:latest \
  python web_detection.py \
    --model_path model/centerpose_regnetx_800mf.hef \
    --camera_id 0

REST API

text
POST http://<Board_IP>:8000/api/models/centerpose_regnetx_800mf/predict
bash
curl -X POST "http://<Board_IP>:8000/api/models/centerpose_regnetx_800mf/predict" \
  -F "file=@test.jpg"

| エンドポイント | メソッド | 用途 | |---|---| | / | GET | WebプレビューUI | | /api/models/centerpose_regnetx_800mf/predict | POST | 単一フレームの姿勢推論 | | /api/video_feed | GET | 注釈付きMJPEGストリーム | | /api/config | GET / POST | 信頼度/NMS閾値の読み取り・変更 | | /api/video/upload | POST | ソース動画のアップロード | | /api/video/analyze | POST | オフライン動画分析の開始 | | /api/video/status | GET | 分析進捗の読み取り | | /api/video/download/{filename} | GET | 注釈付き結果のダウンロード |

実装の詳細

  • ソース:src/rpi5_hailo8_centerpose_regnetx_800mf/
  • Dockerfile:docker/hailo8/centerpose_regnetx_800mf.dockerfile
  • HEF:model/centerpose_regnetx_800mf.hef(14,609,405バイト)
  • デコーダはCenterPoseのhm、wh、hps、reg、hm_hp、hp_offsetの6つの出力ヘッドを処理し、検出結果を入力letterboxの逆変換で元画像にマッピングします。
  • CenterPoseはこのHEFに正規化が組み込まれているため、元のOpenCV BGR順を使用します。

入力と出力

入力:画像、動画、または USB カメラのフレーム。出力:人物ボックス、信頼度、17 個の COCO キーポイント、アノテーション付き MJPEG プレビュー。