CV / Tiny Yolo

Tiny-YOLOv3

Tiny-YOLOv3 detects 80 COCO object classes on Hailo-8. Unlike the on-chip-NMS models, it outputs raw YOLOv3 heads and does the full grid decode (sigmoid + anchor + NMS) on the CPU. First variant of the tiny_yolo series.

1 downloads
Grootte
8.4 MB
Geheugen
4GB+
Precisie
Hailo HEF / HailoRT 4.23.x

Kies het apparaat dat je gebruikt. De installatiehandleiding en documentatie worden dienovereenkomstig bijgewerkt.

Aan de slag

Implementeren
sudo docker run --rm \
  --name cm5-hailo8-tiny-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/tiny_yolov3:latest \
  python web_detection.py --model_path model/tiny_yolov3.hef --video_path video/test.mp4

REST API

Gebruik de REST API om inferentie uit te voeren. Kopieer de onderstaande commando's.

Curl
curl -X POST "http://<Board_IP>:8000/api/models/tiny_yolov3/predict" \
  -F "file=@test.jpg"
Python
import requests

response = requests.post(
    "http://<Board_IP>:8000/api/models/tiny_yolov3/predict",
    files={"file": open("test.jpg", "rb")},
    timeout=30,
)
print(response.json())

Modeldetails

Tiny-YOLOv3 on reComputer R Series (CM5 + Hailo-8)

Tiny-YOLOv3 detects 80 COCO object classes on Hailo-8. Unlike the on-chip-NMS models (SSD, EfficientDet, NanoDet), it outputs raw YOLOv3 heads and does the full grid decode (sigmoid + anchor + NMS) on the CPU. First variant of the tiny_yolo series (tiny_yolov3 / tiny_yolov4).

This page targets reComputer R Series (CM5 + Hailo-8) with a PCIe Hailo-8 accelerator.

Model Info

PropertyValue
ArchitectureTiny-YOLOv3 (base/yolo.yaml)
TaskObject detection
Input416x416x3 RGB (normalize_in_net std=255)
Output2 raw heads: 13x13x255 (stride 32) + 26x26x255 (stride 16)
Classes80 (COCO, 0-indexed)
Parameters8.85M
Operations5.58G
PostprocessCPU YOLOv3 decode (NO on-chip NMS)
HEFHailo Model Zoo v2.19.0, Hailo-8

Hardware and Host Setup

bash
sudo apt update
sudo apt install hailort hailort-pcie-driver python3-hailort
sudo reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0

Run With Demo Video

bash
sudo docker run --rm \
  --name cm5-hailo8-tiny-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/tiny_yolov3:latest \
  python web_detection.py --model_path model/tiny_yolov3.hef --video_path video/test.mp4

Open http://<Board_IP>:8000 to view the web preview.

USB Camera Mode

bash
sudo docker run --rm \
  --name cm5-hailo8-tiny-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/tiny_yolov3:latest \
  python web_detection.py --model_path model/tiny_yolov3.hef --camera_id 0

REST API

text
POST http://<Board_IP>:8000/api/models/tiny_yolov3/predict
bash
curl -X POST "http://<Board_IP>:8000/api/models/tiny_yolov3/predict" \
  -F "file=@test.jpg"
EndpointMethodPurpose
/GETWeb preview UI
/api/models/tiny_yolov3/predictPOSTDetections (JSON)
/api/video_feedGETMJPEG preview stream

Implementation Notes

  • No on-chip NMS — the HEF outputs raw YOLOv3 heads; the app does the full decode on CPU: sigmoid on obj + class scores, anchor-based grid decode, NMS.
  • Decode (official yolo.py _yolo3_decode): center = (sigmoid(raw_xy) + grid) * stride, scale = exp(raw_wh) * anchor, score = sigmoid(obj) * sigmoid(cls).
  • normalize_in_net std=255 (÷255) + padding_color=114 (gray). The app feeds raw uint8 RGB pixels after letterboxing.
  • 3 anchors per scale: stride 32 → [[81,82],[135,169],[344,319]], stride 16 → [[23,27],[37,58],[81,82]].
  • First inference logs head shapes for verification (SOP §10).

Development Notes

  • Source module: src/rpi5_hailo8_tiny_yolov3/
  • Dockerfile: docker/hailo8/tiny_yolov3.dockerfile
  • Container: ghcr.io/seeed-projects/recomputer-hailo8-cv/tiny_yolov3:latest
  • Family: yolo (variants tiny_yolov3 / tiny_yolov4); this is the v3 build.

Invoer en uitvoer

Input: image, video, or USB camera frame. Output: COCO 80-class detection boxes with confidences, plus an annotated MJPEG preview.