CV / CenterPose
CenterPose RegNetX-800MF
CenterPose RegNetX-800MF 多人姿态估计,输出 17 个 COCO 关键点,支持 reComputer R Series + 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 Series(CM5 + Hailo-8)上运行
CenterPose RegNetX-800MF 在单次网络推理中完成自底向上的多人姿态估计。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 |
硬件与主机设置
| 项目 | 值 |
|---|---|
| 开发板 | reComputer R Series 搭配 Raspberry Pi CM5 |
| 加速器 | Hailo-8(PCIe 接口),以 /dev/hailo0 暴露 |
| 操作系统 | 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.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.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 预览界面 |
| /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六个输出头,并把检测结果通过输入 letterbox 逆变换映射回原图。 - CenterPose 使用原始 OpenCV BGR 顺序,因为归一化已编译进该 HEF。
输入与输出
输入:图像、视频或 USB 摄像头帧。输出:人物边界框、置信度、17 个 COCO 关键点及带标注的 MJPEG 预览。