CV / Tiny Yolo
Tiny-YOLOv4
Tiny-YOLOv4 detects 80 COCO object classes on Hailo-8. Same I/O as Tiny-YOLOv3 but with a YOLOv4-tiny backbone (lighter, more accurate). No on-chip NMS — raw YOLOv3 heads decoded on CPU.
Elige el dispositivo que estás usando. La guía de configuración y la documentación se actualizarán en consecuencia.
Primeros pasos
sudo docker run --rm \
--name cm5-hailo8-tiny-yolov4 \
--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_yolov4:latest \
python web_detection.py --model_path model/tiny_yolov4.hef --video_path video/test.mp4API REST
Usa la API REST para ejecutar inferencia. Copia los comandos siguientes.
curl -X POST "http://<Board_IP>:8000/api/models/tiny_yolov4/predict" \
-F "file=@test.jpg"import requests
response = requests.post(
"http://<Board_IP>:8000/api/models/tiny_yolov4/predict",
files={"file": open("test.jpg", "rb")},
timeout=30,
)
print(response.json())Detalles del modelo
Tiny-YOLOv4 on reComputer R Series (CM5 + Hailo-8)
Tiny-YOLOv4 detects 80 COCO object classes on Hailo-8. Same I/O as Tiny-YOLOv3 but with a YOLOv4-tiny backbone (lighter, more accurate). No on-chip NMS — raw YOLOv3 heads decoded on CPU.
This page targets reComputer R Series (CM5 + Hailo-8) with a PCIe Hailo-8 accelerator.
Model Info
| Property | Value |
|---|---|
| Architecture | YOLOv4-tiny (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 | 6.05M |
| Operations | 6.92G |
| 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-yolov4 \
--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_yolov4:latest \
python web_detection.py --model_path model/tiny_yolov4.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-yolov4 \
--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_yolov4:latest \
python web_detection.py --model_path model/tiny_yolov4.hef --camera_id 0REST API
POST http://<Board_IP>:8000/api/models/tiny_yolov4/predictcurl -X POST "http://<Board_IP>:8000/api/models/tiny_yolov4/predict" \
-F "file=@test.jpg"| Endpoint | Method | Purpose |
|---|---|---|
/ | GET | Web preview UI |
/api/models/tiny_yolov4/predict | POST | Detections (JSON) |
/api/video_feed | GET | MJPEG preview stream |
Implementation Notes
- Identical I/O and post-processing to Tiny-YOLOv3 (same base/yolo.yaml, same anchors, same YOLOv3 CPU decode); only the backbone differs (YOLOv4-tiny).
- No on-chip NMS — raw YOLOv3 heads, CPU decode (sigmoid + anchor + NMS).
normalize_in_netstd=255 (÷255) +padding_color=114(gray). Feeds raw uint8 RGB after letterboxing.
Development Notes
- Source module:
src/rpi5_hailo8_tiny_yolov4/ - Dockerfile:
docker/hailo8/tiny_yolov4.dockerfile - Container:
ghcr.io/seeed-projects/recomputer-hailo8-cv/tiny_yolov4:latest - Family: yolo (variants tiny_yolov3 / tiny_yolov4); this is the v4 build.
Entradas y salidas
Input: image, video, or USB camera frame. Output: COCO 80-class detection boxes with confidences, plus an annotated MJPEG preview.