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.
使用しているデバイスを選択してください。セットアップガイドとドキュメントがそれに応じて更新されます。
はじめる
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.mp4REST API
REST API を使用して推論を実行します。以下のコマンドをコピーしてください。
curl -X POST "http://<Board_IP>:8000/api/models/tiny_yolov3/predict" \
-F "file=@test.jpg"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())モデル詳細
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
| Property | Value |
|---|---|
| Architecture | Tiny-YOLOv3 (base/yolo.yaml) |
| Task | Object detection |
| Input | 416x416x3 RGB (normalize_in_net std=255) |
| Output | 2 raw heads: 13x13x255 (stride 32) + 26x26x255 (stride 16) |
| Classes | 80 (COCO, 0-indexed) |
| Parameters | 8.85M |
| Operations | 5.58G |
| Postprocess | CPU YOLOv3 decode (NO on-chip NMS) |
| HEF | Hailo Model Zoo v2.19.0, Hailo-8 |
Hardware and Host Setup
sudo apt update
sudo apt install hailort hailort-pcie-driver python3-hailort
sudo reboot
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0Run With Demo Video
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.mp4Open http://<Board_IP>:8000 to view the web preview.
USB Camera Mode
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 0REST API
POST http://<Board_IP>:8000/api/models/tiny_yolov3/predictcurl -X POST "http://<Board_IP>:8000/api/models/tiny_yolov3/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/tiny_yolov3/predict | POST | Detections (JSON) |
/api/video_feed | GET | MJPEG 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_netstd=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.
入力と出力
Input: image, video, or USB camera frame. Output: COCO 80-class detection boxes with confidences, plus an annotated MJPEG preview.