CV / YOLOv6
YOLOv6
YOLOv6 COCO object detection on reComputer RK3576/RK3588 through RKNN and on reComputer R Series with Hailo-8 or Hailo-10H through HailoRT.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm --privileged --net=host --device /dev/dri/renderD128:/dev/dri/renderD128 \
-v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
ghcr.io/seeed-projects/recomputer-rk-cv/rk3576-yolov6:latest \
python3 web_detection.py --platform rk3576 --model_path model/yolov6n.rknn --video_path video/test.mp4REST API
Use the REST API to run inference. Copy the commands below.
curl http://localhost:8080/v1/chat/completions -d '{
"model": "yolov6",
"messages": [{"role": "user", "content": "Hello"}]
}'import requests
resp = requests.post(
"http://localhost:8080/v1/chat/completions",
json={"model": "yolov6", "messages": [{"role": "user", "content": "Hello"}]},
)
print(resp.json())Model Details
reComputer R Series (CM5 + Hailo-8)YOLOv6n on reComputer R Series (CM5 + Hailo-8)
YOLOv6n performs COCO 80-class object detection on Hailo-8 through HailoRT. The compiled HEF either returns the on-chip HPP NMS result or the nine raw split heads; the app handles both and logs which layout the HEF produced.
This page targets reComputer R Series (CM5 + Hailo-8) with a PCIe Hailo-8 accelerator.
Hardware and Host Setup
| Item | Value |
|---|---|
| Board | reComputer R Series with Raspberry Pi CM5 |
| Accelerator | Hailo-8 over PCIe, exposed as /dev/hailo0 |
| Runtime | HailoRT 4.23.x |
| Python in container | 3.11, aarch64 |
Install the Hailo-8 packages on the host and confirm that the driver and device are ready before starting the container:
sudo apt update
sudo apt install hailort hailort-pcie-driver python3-hailort
sudo reboot
# After reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0The expected HailoRT version for this image is 4.23.x.
Run With Demo Video
sudo docker run --rm \
--name cm5-hailo8-yolov6n \
--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/yolov6n:latest \
python web_detection.py --model_path model/yolov6n.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-yolov6n \
--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/yolov6n:latest \
python web_detection.py --model_path model/yolov6n.hef --camera_id 0HEF File
| HEF | Size | Notes |
|---|---|---|
yolov6n.hef | 5,774,047 (5.5 MB) | The HEF comes from the Hailo Model Zoo v2.19.0 build for Hailo-8; parameters 4.32M, operations 11.12G. |
Source: https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v2.19.0/hailo8/yolov6n.hef.
REST API
POST http://<Board_IP>:8000/api/models/yolov6n/predictcurl -X POST "http://<Board_IP>:8000/api/models/yolov6n/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/yolov6n/predict | POST | Detections (JSON) |
/api/video_feed | GET | MJPEG preview stream |
Implementation Notes
- The Model Zoo
base/yolov6.yamluseshpp=true,meta_arch=yolo_v6,score_threshold=0.03andnms_iou_thresh=0.65;info.output_shapedocuments the nine raw split heads (4 box, 1 objectness, 80 classes per stride 32/16/8). - The module handles both compile layouts: when the HEF already ran NMS (HPP) it parses the post-NMS tensor (compact per-class buffer, dense
Cx5xD/CxDx5, ragged NMS-by-score list); when the HEF returns the raw split heads it decodes the distances around the cell centre (stride units), multiplies sigmoid(classes) by sigmoid(objectness) and runs a per-class NMS with the IOU slider value. [YOLOv6n] layout=...is printed once on the first inference so the layout can be confirmed on hardware.- The HEF bakes
normalize_in_net(mean 0 / std 255) 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). - Defaults: confidence 0.25; with the on-chip NMS layout the IOU slider has no effect, with the raw-head layout it drives the host-side NMS.
Development Notes
- Source module:
src/hailo10h_yolov6n/(Hailo-10H) orsrc/rpi5_hailo8_yolov6n/(Hailo-8) in the matching model repository - Container:
ghcr.io/seeed-projects/recomputer-hailo8-cv/yolov6n:latest - Only YOLOv6n is published by the Hailo Model Zoo; YOLOv6s/m/l have no Hailo HEF.
- Model licence: GPL-3.0 (upstream meituan/YOLOv6).
Inputs and Outputs
Input: image, video frame, or camera frame. Output: COCO classes, confidence scores, and boxes.