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.
Elige el dispositivo que estás usando. La guía de configuración y la documentación se actualizarán en consecuencia.
Primeros pasos
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.mp4API REST
Usa la API REST para ejecutar inferencia. Copia los comandos siguientes.
curl -X POST "http://<Board_IP>:8000/api/models/vit_pose_small/predict" \
-F "file=@test.jpg"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())Detalles del modelo
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
| Property | Value |
|---|---|
| Architecture | ViT-Small (ViTPose) |
| Task | Single-person pose estimation |
| Input | 256x192x3 RGB (normalize_in_net ImageNet RGB) |
| Output | Heatmap 64x48x17 (17 COCO keypoints) |
| Parameters | 24.29M |
| Operations | 17.17G |
| HEF | Hailo Model Zoo v2.19.0, Hailo-8 |
Hardware and Host Setup
sudo apt update
sudo apt install hailort hailort-pcie-driver python3-hailort
sudo reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0Run With Demo Video
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.mp4Open http://<Board_IP>:8000 to view the web preview.
USB Camera Mode
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 0REST API
POST http://<Board_IP>:8000/api/models/vit_pose_small/predictcurl -X POST "http://<Board_IP>:8000/api/models/vit_pose_small/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/vit_pose_small/predict | POST | 17 keypoints (JSON) |
/api/video_feed | GET | MJPEG 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_netwith 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)
Entradas y salidas
Input: image, video, or USB camera frame. Output: 17 COCO keypoints (x, y, score) with skeleton overlay on MJPEG preview.