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.

12 downloads
Size
54.7 MB
Memory
4GB+
Precision
Hailo HEF

Choose the device you're using, the set up guide and documentation will update accordingly.

Getting Started

Deploy
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.mp4

Model 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

VariantInputPackaged HEFmAP float / Hailo-8FPS (batch 1)Params / OpsContainer
YOLOv3608×608×354.7 MB38.4 / 38.337.868.79M / 158.10Gyolov3
YOLOv3-416416×416×356.6 MB37.7 / 37.647.861.92M / 65.94Gyolov3_416
YOLOv3-Gluon608×608×350.8 MB37.3 / 35.838.168.79M / 140.7Gyolov3_gluon
YOLOv3-Gluon-416416×416×356.2 MB36.3 / 34.349.061.92M / 65.94Gyolov3_gluon_416

Hardware and Host Setup

ItemValue
BoardreComputer R Series with Raspberry Pi CM5
AcceleratorHailo-8 over PCIe, exposed as /dev/hailo0
RuntimeHailoRT 4.23.x (host / container must share major.minor)
Python in container3.11, aarch64
bash
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 docker

Run With Demo Video

Select the command matching the model variant.

YOLOv3

bash
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.mp4

YOLOv3-416

bash
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.mp4

YOLOv3-Gluon

bash
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.mp4

YOLOv3-Gluon-416

bash
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.mp4

Open http://<Board_IP>:8000 to view detections. The bundled video/test.mp4 is the demo clip used for verification.

USB Camera Mode

bash
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 0

Swap yolov3 for another variant image/model name to run YOLOv3-416, YOLOv3-Gluon or YOLOv3-Gluon-416.

REST API

VariantEndpoint
YOLOv3POST /api/models/yolov3/predict
YOLOv3-416POST /api/models/yolov3_416/predict
YOLOv3-GluonPOST /api/models/yolov3_gluon/predict
YOLOv3-Gluon-416POST /api/models/yolov3_gluon_416/predict
bash
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's 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.