CV / CenterPose
CenterPose RegNetX-800MF
reComputer R Series (CM5 + Hailo-10H)
CenterPose RegNetX-800MF 多人姿态估计,输出 17 个 COCO 关键点,支持 reComputer R Series + Hailo-8 或 Hailo-10H。
选择你正在使用的设备,设置指南和文档将相应更新。
快速开始
sudo docker run --rm \
--name cm5-hailo10h-centerpose \
--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/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-10H)CenterPose RegNetX-800MF 在 reComputer R Series(CM5 + Hailo-10H)上运行
CenterPose RegNetX-800MF 在单次网络推理中完成自底向上的多人姿态估计。Hailo-10H 演示返回人体框与 17 个 COCO 身体关键点,并通过 FastAPI 服务提供实时 MJPEG 预览、单图推理和离线视频分析。
模型信息
| 属性 | 值 |
|---|---|
| 架构 | CenterPose,RegNetX-800MF 骨干网络 |
| 任务 | 多人姿态估计 |
| 输入 | 512×512×3 BGR |
| 输出 | 人体框与 17 个 COCO 关键点 |
| 参数量 | 12.31M |
| 硬件 AP | 43.1(Hailo Model Zoo 参考值) |
| HEF 来源 | Hailo Model Zoo v5.4.0,为 Hailo-10H 编译 |
| 运行时 | HailoRT 5.1.1 |
硬件与主机设置
| 项目 | 值 |
|---|---|
| 开发板 | reComputer R Series 搭配 Raspberry Pi CM5 |
| 加速器 | Hailo-10H(PCIe 接口),以 /dev/hailo0 暴露 |
| 操作系统 | Raspberry Pi OS,aarch64 |
| 已验证运行时 | HailoRT 5.1.1 |
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot
# 重启后验证
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0不要将 HailoRT 4.23.x(Hailo-8)的驱动、库或 Python wheel 混入这个 Hailo-10H 容器。
使用内置演示视频运行
sudo docker run --rm \
--name cm5-hailo10h-centerpose \
--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/centerpose_regnetx_800mf:latest \
python web_detection.py \
--model_path model/centerpose_regnetx_800mf.hef \
--video_path video/test.mp4打开 http://<Board_IP>:8000 查看带标注的视频流和视频分析界面。
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.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/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 预览界面 |
| /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/hailo10h_centerpose_regnetx_800mf/ - Dockerfile:
docker/hailo10h/centerpose_regnetx_800mf.dockerfile - HEF:
model/centerpose_regnetx_800mf.hef(14,581,760 字节) - 解码器处理 CenterPose 的
hm、wh、hps、reg、hm_hp、hp_offset六个输出头,并把检测结果通过输入 letterbox 逆变换映射回原图。 - CenterPose 使用原始 OpenCV BGR 顺序,因为归一化已编译进该 HEF。
- 执行器使用 HailoRT 5.1.1 的
create_infer_modelAPI,配置持久化并注册 FLOAT32 输出缓冲区。
输入与输出
输入:图像、视频或 USB 摄像头帧。输出:人物边界框、置信度、17 个 COCO 关键点及带标注的 MJPEG 预览。