CV / YOLOv3
YOLOv3
reComputer R Series (CM5 + Hailo-8)
COCO 80-class object detection with YOLOv3 / YOLOv3-416 / YOLOv3-Gluon / YOLOv3-Gluon-416 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 pi5-hailo8-yolov3 \
--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/yolov3:latest \
python web_detection.py --model_path model/yolov3.hef --video_path video/test.mp4Model Details
reComputer R Series (CM5 + Hailo-8)YOLOv3 / YOLOv3-416 / YOLOv3-Gluon / YOLOv3-Gluon-416 COCO Detection on reComputer R Series (CM5 + Hailo-8)
The four YOLOv3 variants detect 80 COCO classes on Hailo-8 through HailoRT 4.23. Each HEF outputs three raw YOLOv3 heads; the host performs the full grid decode (sigmoid + anchors + NMS) and draws boxes on the MJPEG preview. The variants share the same web service.
Model Info
| Variant | Input | Packaged HEF | mAP float / Hailo-8 | FPS (batch 1) | Params / Ops | Container |
|---|---|---|---|---|---|---|
| YOLOv3 | 608×608×3 | 54.7 MB | 38.4 / 38.3 | 37.8 | 68.79M / 158.10G | yolov3 |
| YOLOv3-416 | 416×416×3 | 56.6 MB | 37.7 / 37.6 | 47.8 | 61.92M / 65.94G | yolov3_416 |
| YOLOv3-Gluon | 608×608×3 | 50.8 MB | 37.3 / 35.8 | 38.1 | 68.79M / 140.7G | yolov3_gluon |
| YOLOv3-Gluon-416 | 416×416×3 | 56.2 MB | 36.3 / 34.3 | 49.0 | 61.92M / 65.94G | yolov3_gluon_416 |
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 (host / container must share major.minor) |
| Python in container | 3.11, aarch64 |
sudo apt update
sudo apt install hailo-all -y
sudo reboot
# After reboot
hailortcli fw-control identify
ls /dev/hailo0
# Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh --mirror Aliyun
sudo systemctl enable docker
sudo systemctl start dockerRun With Demo Video
Select the command matching the model variant.
YOLOv3
sudo docker run --rm \
--name pi5-hailo8-yolov3 \
--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/yolov3:latest \
python web_detection.py --model_path model/yolov3.hef --video_path video/test.mp4YOLOv3-416
sudo docker run --rm \
--name pi5-hailo8-yolov3-416 \
--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/yolov3_416:latest \
python web_detection.py --model_path model/yolov3_416.hef --video_path video/test.mp4YOLOv3-Gluon
sudo docker run --rm \
--name pi5-hailo8-yolov3-gluon \
--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/yolov3_gluon:latest \
python web_detection.py --model_path model/yolov3_gluon.hef --video_path video/test.mp4YOLOv3-Gluon-416
sudo docker run --rm \
--name pi5-hailo8-yolov3-gluon-416 \
--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/yolov3_gluon_416:latest \
python web_detection.py --model_path model/yolov3_gluon_416.hef --video_path video/test.mp4Open http://<Board_IP>:8000 to view detections. The bundled video/test.mp4
is the demo clip used for verification.
USB Camera Mode
sudo docker run --rm \
--name pi5-hailo8-yolov3 \
--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/yolov3:latest \
python web_detection.py --model_path model/yolov3.hef --camera_id 0Swap yolov3 for another variant image/model name to run YOLOv3-416,
YOLOv3-Gluon or YOLOv3-Gluon-416.
REST API
| Variant | Endpoint |
|---|---|
| YOLOv3 | POST /api/models/yolov3/predict |
| YOLOv3-416 | POST /api/models/yolov3_416/predict |
| YOLOv3-Gluon | POST /api/models/yolov3_gluon/predict |
| YOLOv3-Gluon-416 | POST /api/models/yolov3_gluon_416/predict |
curl -X POST "http://<Board_IP>:8000/api/models/yolov3/predict" \
-F "file=@test.jpg"Returns predictions entries with COCO class, confidence and box.
Implementation Notes
- The HEFs expose three raw YOLOv3 heads with no on-chip NMS. The host runs sigmoid, anchor-based grid decode and NMS.
- Decode:
center = (sigmoid(xy) + grid) * stride,size = exp(wh) * anchor,score = sigmoid(obj) * sigmoid(cls). - Pre-processing letterboxes to the HEF input size with padding 114 and converts BGR to RGB; normalization is compiled into the HEF.
- Anchors: stride 32
[[116,90],[156,198],[373,326]], stride 16[[30,61],[62,45],[59,119]], stride 8[[10,13],[16,30],[33,23]].
Development Notes
- Sources:
src/rpi5_hailo8_yolov3{,_416,_gluon,_gluon_416}/ - Dockerfiles:
docker/hailo8/yolov3{,_416,_gluon,_gluon_416}.dockerfile - Containers:
ghcr.io/seeed-projects/recomputer-hailo8-cv/yolov3{,_416,_gluon,_gluon_416}:latest - HEFs: Hailo Model Zoo v2.20.0 (
hailo8), sizes and SHA256 recorded in each module'smodel/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.