CV / YOLOv8

YOLOv8-seg

reComputer R Series (CM5 + Hailo-10H)

YOLOv8n/s/m instance segmentation on reComputer RK3588/RK3576 (RKNN) and on reComputer R Series with Hailo-8 or Hailo-10H through HailoRT.

575 downloads
Size
~7.2MB
Memory
1GB+
Precision
INT8

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-yolov8n-seg \
  --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/yolov8n_seg:latest \
  python web_detection.py --model_path model/yolov8n_seg.hef --video_path video/test.mp4

Model Details

reComputer R Series (CM5 + Hailo-10H)

YOLOv8-seg on reComputer CM5 + Hailo-10H

YOLOv8n/s/m-seg models run on Hailo-10H through HailoRT 5.1.1. The HEF exposes raw heads (no on-chip NMS): the host decodes the box heads (DFL or folded layout), applies sigmoid + per-class NMS and assembles the prototype masks (32 coefficients × 160×160×32 prototype, cropped to each box) for 80 COCO classes.

Model Info

VariantInputPackaged HEFContainer image
YOLOv8n-seg640×640×3 RGB6.1 MByolov8n_seg
YOLOv8s-seg640×640×3 RGB18.6 MByolov8s_seg
YOLOv8m-seg640×640×3 RGB28.9 MByolov8m_seg

Hardware and Host Setup

ItemValue
BoardRaspberry Pi CM5
AcceleratorHailo-10H, /dev/hailo0
RuntimeHailoRT 5.1.1
OSRaspberry Pi OS Bookworm, 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

Select the command matching the model variant.

YOLOv8n-seg

bash
sudo docker run --rm --privileged --net=host \
  --name cm5-hailo10h-yolov8n-seg \
  -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/yolov8n_seg:latest \
  python web_detection.py --model_path model/yolov8n_seg.hef --video_path video/test.mp4

YOLOv8s-seg

bash
sudo docker run --rm --privileged --net=host \
  --name cm5-hailo10h-yolov8s-seg \
  -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/yolov8s_seg:latest \
  python web_detection.py --model_path model/yolov8s_seg.hef --video_path video/test.mp4

YOLOv8m-seg

bash
sudo docker run --rm --privileged --net=host \
  --name cm5-hailo10h-yolov8m-seg \
  -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/yolov8m_seg:latest \
  python web_detection.py --model_path model/yolov8m_seg.hef --video_path video/test.mp4

Open http://<Board_IP>:8000 for the Web preview. Use /api/video_feed for the MJPEG stream with instance masks and boxes overlaid.

REST API

Each variant has its own endpoint:

VariantEndpoint
YOLOv8n-segPOST /api/models/yolov8n_seg/predict
YOLOv8s-segPOST /api/models/yolov8s_seg/predict
YOLOv8m-segPOST /api/models/yolov8m_seg/predict

Example:

bash
curl -X POST "http://<Board_IP>:8000/api/models/yolov8n_seg/predict" \
  -F "file=@test.jpg"

The response contains predictions entries with class, confidence and box fields (box is x1/y1/x2/y2 in original-frame pixels).

Expected Result and Common Errors

On the first inference the module prints the loaded vstream list plus one layout line per inference type: the 10 output tensors, their value ranges and whether a sigmoid was applied. Expected: three box heads, three 80-channel score heads, three 32-channel mask-coefficient heads and one 160×160×32 prototype; a preview where masks stick to the instances.

SymptomLikely causeFix
unexpected output layout in the logDifferent HEF compileCheck the printed shapes against the list above; do not guess the layout
HailoRT version error on startHost library not 5.1.1Install hailo-h10-all on the host and keep the container mount at libhailort.so.5.1.1
docker: container name already in useA previous container was not removeddocker rm -f cm5-hailo10h-yolov8n-seg, or change --name
No /dev/hailo0 inside the containerMissing --device /dev/hailo0:/dev/hailo0Add the device mapping and --privileged --net=host

Development

VariantSourceDockerfile
YOLOv8n-segsrc/hailo10h_yolov8n_seg/docker/hailo10h/yolov8n_seg.dockerfile
YOLOv8s-segsrc/hailo10h_yolov8s_seg/docker/hailo10h/yolov8s_seg.dockerfile
YOLOv8m-segsrc/hailo10h_yolov8m_seg/docker/hailo10h/yolov8m_seg.dockerfile
  • Executor: HailoRT 5.1.1 InferModel wrapper (Python 3.13 + the bundled cp313 wheel); regression tests live in each module's tests/.
  • HEFs: Hailo Model Zoo v5.4.0 Hailo-10H builds.
  • Letterbox padding is 114 (Model Zoo base/yolo.yaml); normalization is compiled into the HEF. Referenced mAP values are Model Zoo full-precision figures, not measurements on this board.