CV / YOLOv5
YOLOv5
reComputer R Series (CM5 + Hailo-10H)
YOLOv5n/s/m object detection models on reComputer RK3588/RK3576 (RKNN) and on reComputer R Series with Hailo-8 or Hailo-10H.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm \
--name cm5-hailo10h-yolov5s \
--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/yolov5s:latest \
python web_detection.py --model_path model/yolov5s.hef --video_path video/test.mp4Model Details
reComputer R Series (CM5 + Hailo-10H)YOLOv5 on reComputer R Series (CM5 + Hailo-10H)
YOLOv5s and YOLOv5m perform COCO 80-class object detection on Hailo-10H through HailoRT. NMS and sigmoid run on-chip (Hailo HPP), so the host only parses the post-NMS tensor.
This page targets reComputer R Series (CM5 + Hailo-10H) with a PCIe Hailo-10H accelerator.
Hardware and Host Setup
| Item | Value |
|---|---|
| Board | reComputer R Series with Raspberry Pi CM5 |
| Accelerator | Hailo-10H over PCIe, exposed as /dev/hailo0 |
| Runtime | HailoRT 5.1.1 |
| Python in container | 3.13, aarch64 |
Install the Hailo-10H packages on the host and confirm that the driver and device are ready before starting the container:
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot
# After reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0The expected HailoRT version for these images is 5.1.1.
Run With Demo Video
YOLOv5s:
sudo docker run --rm \
--name cm5-hailo10h-yolov5s \
--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/yolov5s:latest \
python web_detection.py --model_path model/yolov5s.hef --video_path video/test.mp4YOLOv5m:
sudo docker run --rm \
--name cm5-hailo10h-yolov5m \
--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/yolov5m:latest \
python web_detection.py --model_path model/yolov5m.hef --video_path video/test.mp4Open http://<Board_IP>:8000 to view the web preview.
USB Camera Mode
sudo docker run --rm \
--name cm5-hailo10h-yolov5s \
--privileged \
--net=host \
-e PYTHONUNBUFFERED=1 \
--device /dev/hailo0:/dev/hailo0 \
--device /dev/video0:/dev/video0 \
-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/yolov5s:latest \
python web_detection.py --model_path model/yolov5s.hef --camera_id 0Swap yolov5s for yolov5m to use the medium variant.
HEF Files
| HEF | Size | Notes |
|---|---|---|
yolov5s.hef | 13,029,376 (12.4 MB) | 7.46M params, 17.44G ops |
yolov5m.hef | 19,812,352 (18.9 MB) | 21.78M params, 52.17G ops |
YOLOv5s is the small, YOLOv5m the medium variant; both are Hailo Model Zoo v5.4.0 Hailo-10H builds.
Source: https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v5.4.0/hailo10h/yolov5s.hef (yolov5m.hef in the same directory).
REST API
POST http://<Board_IP>:8000/api/models/yolov5s/predictcurl -X POST "http://<Board_IP>:8000/api/models/yolov5s/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/yolov5s/predict | POST | Detections (JSON) |
/api/video_feed | GET | MJPEG preview stream |
Implementation Notes
- The HEF runs NMS and sigmoid on-chip (zoo
base/yolo.yaml:nms: true,hpp: true), sonms_threshis accepted for API parity but ignored. - Post-NMS rows are
[ymin, xmin, ymax, xmax, score], normalized to [0,1] of the 640x640 letterboxed input; the app scales to pixels and un-letterboxes. - The HEF bakes
normalize_in_net(mean 0 / std 255, a /255 scale) andpadding_color=114: the app letterboxes with gray (114) and feeds raw uint8 RGB pixels — no manual normalization. - Class IDs 0..79 index the standard COCO class list directly (the Model Zoo evaluation uses
labels_offset=1). - The Model Zoo documents the post-NMS shape as 80x5x80; the parser accepts the real layout at runtime and logs it once (
[YOLOv5] raw output type=..., shape=...) for on-device verification. - Defaults: confidence 0.25; the IOU slider has no effect because NMS is on-chip.
Development Notes
- Source modules:
src/hailo10h_yolov5s/,src/hailo10h_yolov5m/ - Dockerfiles:
docker/hailo10h/yolov5s.dockerfile,docker/hailo10h/yolov5m.dockerfile - Containers:
ghcr.io/seeed-projects/recomputer-hailo10h-cv/yolov5s:latest,.../yolov5m:latest - Both modules use the HailoRT 5.1.1 InferModel API and Hailo-10H-specific HEFs.
- Unit tests run without a device:
python -m unittest discover -s tests -v.