CV / ViTPose

ViTPose-Small

ViTPose-Small uses a Vision Transformer backbone to estimate 17 COCO body keypoints for a single person. The HEF outputs a 64x48x17 heatmap; the app does argmax per channel and draws the skeleton.

1 downloads
Size
31 MB
Memory
4GB+
Precision
Hailo HEF / HailoRT 4.23.x

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-vitpose-small \
  --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/vit_pose_small:latest \
  python web_detection.py --model_path model/vit_pose_small.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/vit_pose_small/predict" \
  -F "file=@test.jpg"
Python
import requests
response = requests.post(
    "http://<Board_IP>:8000/api/models/vit_pose_small/predict",
    files={"file": open("test.jpg", "rb")},
    timeout=30,
)
print(response.json())

Model Details

ViTPose-Small on reComputer R Series (CM5 + Hailo-8)

ViTPose-Small performs single-person 2D pose estimation, outputting 17 COCO body keypoints. The HEF outputs a 64x48x17 heatmap; the app does argmax per channel, scales to input space, and draws the skeleton.

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

Model Info

PropertyValue
ArchitectureViT-Small (ViTPose)
TaskSingle-person pose estimation
Input256x192x3 RGB (normalize_in_net ImageNet RGB)
OutputHeatmap 64x48x17 (17 COCO keypoints)
Parameters24.29M
Operations17.17G
HEFHailo Model Zoo v2.19.0, Hailo-8

Hardware and Host Setup

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-vitpose-small \
  --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/vit_pose_small:latest \
  python web_detection.py --model_path model/vit_pose_small.hef --video_path video/test.mp4

Open http://<Board_IP>:8000 to view the web preview.

USB Camera Mode

bash
sudo docker run --rm \
  --name cm5-hailo8-vitpose-small \
  --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/vit_pose_small:latest \
  python web_detection.py --model_path model/vit_pose_small.hef --camera_id 0

REST API

text
POST http://<Board_IP>:8000/api/models/vit_pose_small/predict
bash
curl -X POST "http://<Board_IP>:8000/api/models/vit_pose_small/predict" \
  -F "file=@test.jpg"
EndpointMethodPurpose
/GETWeb preview UI
/api/models/vit_pose_small/predictPOST17 keypoints (JSON)
/api/video_feedGETMJPEG preview with skeleton

Implementation Notes

  • Single-person: the model assumes the person is centered in the crop. For multi-person, a detector (YOLO) must crop each person first.
  • Post-processing: argmax per heatmap channel → coords in 64×48 → scale to 256×192 input → un-letterbox to original frame. No DARK sub-pixel refinement.
  • normalize_in_net with ImageNet RGB mean/std; no input_conversion → feed raw uint8 RGB after letterboxing.

Development Notes

  • Source module: src/rpi5_hailo8_vit_pose_small/
  • Dockerfile: docker/hailo8/vit_pose_small.dockerfile
  • Container: ghcr.io/seeed-projects/recomputer-hailo8-cv/vit_pose_small:latest
  • Family: vit_pose (variants vit_pose_small / vit_pose_small_bn planned)

Inputs and Outputs

Input: image, video, or USB camera frame. Output: 17 COCO keypoints (x, y, score) with skeleton overlay on MJPEG preview.