CV / CenterPose
CenterPose RegNetX-800MF
CenterPose RegNetX-800MFによる複数人姿勢推定(17個のCOCOキーポイント)。reComputer Rシリーズ + Hailo-8 / Hailo-10H対応。
使用しているデバイスを選択してください。セットアップガイドとドキュメントがそれに応じて更新されます。
はじめる
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.mp4REST API
REST API を使用して推論を実行します。以下のコマンドをコピーしてください。
curl -X POST "http://<Board_IP>:8000/api/models/centerpose_regnetx_800mf/predict" \
-F "file=@test.jpg"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として公開 |
| OS | Raspberry Pi OS, aarch64 |
| 検証済みランタイム | HailoRT 4.23.x |
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アプリケーションから再利用しています。
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.mp4http://<Board_IP>:8000を開くと、注釈付きストリームと動画分析UIを確認できます。
USBカメラモード
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 0REST API
POST http://<Board_IP>:8000/api/models/centerpose_regnetx_800mf/predictcurl -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 プレビュー。