CV / MSPN Pose

MSPN RegNetX-800MF

MSPN single-person pose estimation with 17 COCO keypoints on reComputer R Series with Hailo-8 or Hailo-10H.

51 downloads
Size
5.8 MB
Memory
4GB+
Precision
Hailo HEF / HailoRT

Choose the device you're using, the set up guide and documentation will update accordingly.

Getting Started

Deploy
sudo docker run --rm \
  --name cm5-hailo8-mspn-regnetx-800mf \
  --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/mspn_regnetx_800mf:latest \
  python web_detection.py --model_path model/mspn_regnetx_800mf.hef --video_path video/test.mp4

REST API

Use the REST API to run inference. Copy the commands below.

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

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

Model Details

reComputer R Series

MSPN RegNetX-800MF on reComputer R Series (CM5 + Hailo-8)

MSPN (Multi-Stage Pose Network) with a RegNetX-800MF backbone performs single-person pose estimation with 17 COCO keypoints. The HEF outputs a 64x48x17 heatmap; the app does argmax per channel, scales to input space, and draws the COCO skeleton.

This page targets reComputer R Series (CM5 + Hailo-8) with a PCIe Hailo-8 accelerator.

Model Info

PropertyValue
ArchitectureMSPN + RegNetX-800MF
TaskSingle-person pose estimation
Input256x192x3 RGB (normalize_in_net ImageNet RGB)
OutputHeatmap 64x48x17 (17 COCO keypoints)
Parameters7.17M
Operations2.94G
Hardware AP70.3%
FPS2126
HEFHailo Model Zoo v2.19.0, Hailo-8

Hardware and Host Setup

The Hailo-8 driver, firmware, host libhailort.so, and the Python wheel in the image must use matching HailoRT major/minor versions (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

Run With Demo Video

bash
sudo docker run --rm \
  --name cm5-hailo8-mspn-regnetx-800mf \
  --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/mspn_regnetx_800mf:latest \
  python web_detection.py --model_path model/mspn_regnetx_800mf.hef --video_path video/test.mp4

Open http://<Board_IP>:8000 to view the web preview with the keypoint skeleton overlay.

USB Camera Mode

bash
sudo docker run --rm \
  --name cm5-hailo8-mspn-regnetx-800mf \
  --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/mspn_regnetx_800mf:latest \
  python web_detection.py --model_path model/mspn_regnetx_800mf.hef --camera_id 0

REST API

bash
curl -X POST "http://<Board_IP>:8000/api/models/mspn_regnetx_800mf/predict" \
  -F "file=@test.jpg"
EndpointMethodPurpose
/api/models/mspn_regnetx_800mf/predictPOST17 COCO keypoints (JSON)
/api/video_feedGETMJPEG preview stream

Implementation Details

  • Source module: src/rpi5_hailo8_mspn_regnetx_800mf/
  • Dockerfile: docker/hailo8/mspn_regnetx_800mf.dockerfile
  • normalize_in_net with ImageNet RGB mean/std; no input_conversion — feed raw uint8 RGB after letterboxing.
  • Decode: argmax per heatmap channel → (x, y) in 64x48 space → scale to 256x192 → un-letterbox to the original frame. The raw vstream layout is logged once at first inference.
  • Single-person model: it assumes one centered person. For multiple people, run a detector first and crop each person.
  • The Model Zoo reference adds a 5x5 Gaussian blur and a quarter-pixel shift; this demo skips both.

Troubleshooting

  • HEF fails to load: confirm HailoRT is 4.23.x and the mounted libhailort.so matches the host driver.
  • No /dev/hailo0: check lsmod | grep hailo and reinstall hailort-pcie-driver.
  • No skeleton drawn: lower the keypoint confidence slider (default 0.30).
  • Wrong keypoint positions: confirm the printed input/output shapes match the 256x192 input and 64x48x17 heatmap.

Inputs and Outputs

Input: image (256x192 RGB). Output: 17 keypoints with x, y, confidence (COCO format).