CV / NanoDet

NanoDet-RepVGG-a12

reComputer R Series (CM5 + Hailo-10H)

COCO 80-class object detection with nanodet_repvgg_a12 (YOLOX-based, on-chip NMS) on reComputer R Series with Hailo-8 or Hailo-10H.

40 downloads
Size
7.5 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-hailo10h-nanodet-repvgg-a12 \
  --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/nanodet_repvgg_a12:latest \
  python web_detection.py --model_path model/nanodet_repvgg_a12.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/nanodet_repvgg_a12/predict" \
  -F "file=@test.jpg"
Python
import requests

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

Model Details

reComputer R Series (CM5 + Hailo-10H)

NanoDet-RepVGG-a12 on reComputer CM5 + Hailo-10H

NanoDet-RepVGG performs COCO 80-class object detection on Hailo-10H with on-chip NMS (Hailo HPP). The HEF emits already-decoded detections and the app only parses the post-NMS tensor. Ported from the validated Hailo-8 module rpi5_hailo8_nanodet_repvgg_a12; the executor uses the HailoRT 5.1.1 create_infer_model multi-output wrapper with FLOAT32 outputs.

Model Info

PropertyValue
ArchitectureNanoDet-RepVGG (COCO-80)
TaskObject detection
InputRead from the HEF at startup (printed on first run)
Outputon-chip NMS tensor, post-NMS shape 80x5x100
Classes80 (COCO, 0-indexed — no labels_offset)
HEFHailo Model Zoo v5.4.0, Hailo-10H (4.6 MB)

Hardware and Host Setup

ItemValue
BoardreComputer R Series with Raspberry Pi CM5
AcceleratorHailo-10H over PCIe, exposed as /dev/hailo0
Host driverhailo-h10-all apt package
RuntimeHailoRT 5.1.1
Python in container3.13, aarch64
bash
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot

# After reboot
hailortcli fw-control identify
ls /dev/hailo0

Run With Demo Video

bash
sudo docker run --rm \
  --name cm5-hailo10h-nanodet-repvgg-a12 \
  --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/nanodet_repvgg_a12:latest \
  python web_detection.py --model_path model/nanodet_repvgg_a12.hef --video_path video/test.mp4

Open http://<Board_IP>:8000 to view the web preview. For a USB camera, mount /dev/video0 and replace --video_path video/test.mp4 with --camera_id 0.

REST API

bash
curl -X POST "http://<Board_IP>:8000/api/models/nanodet_repvgg_a12/predict" \
  -F "file=@test.jpg"
EndpointMethodDescription
/healthGETHealth check
/api/models/nanodet_repvgg_a12/predictPOSTDetections (JSON)
/api/video_feedGETMJPEG preview stream

Implementation notes

  • The HEF runs NMS on-chip; the app only parses the post-NMS tensor, so nms_thresh is ignored (kept for API parity).
  • Post-NMS rows are [ymin, xmin, ymax, xmax, score], normalized to [0,1] of the letterboxed input; the app scales to pixels and un-letterboxes.
  • Input preprocessing (normalization / color conversion) is compiled into the HEF; the app letterboxes and feeds raw uint8 pixels.
  • HailoRT may return the NMS vstream as a ragged per-class list (NMS-by-score); the parser handles that plus object/dense layouts. First inference logs the raw type/shape for on-device verification.
  • Executor outputs are requested as FormatType.FLOAT32 (dequantized by the SDK); reading the raw quantized buffers yields values in the tens of thousands and zero valid detections.
  • Class mapping: cls_id (0..79) → standard COCO 80-class list directly.

Model source

nanodet_repvgg.hef is the Hailo-10H build from Hailo Model Zoo v5.4.0 — URL, SHA256 and size are recorded in the repository (src/hailo10h_nanodet_repvgg_a12/model/README.md).

Inputs and Outputs

Input: image, video, or USB camera frame. Output: COCO 80-class detection boxes with confidences, plus an annotated MJPEG preview.