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.

1 descargas
Tamaño
7.3 MB
Memoria
4GB+
Precisión
Hailo HEF / HailoRT 4.23.x

Elige el dispositivo que estás usando. La guía de configuración y la documentación se actualizarán en consecuencia.

Primeros pasos

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

API REST

Usa la API REST para ejecutar inferencia. Copia los comandos siguientes.

Curl
curl -X POST "http://<Board_IP>:8000/api/models/tiny_yolov4/predict" \
  -F "file=@test.jpg"
Python
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

PropertyValue
ArchitectureYOLOv4-tiny (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)
Parameters6.05M
Operations6.92G
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-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.mp4

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

USB Camera Mode

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

REST API

text
POST http://<Board_IP>:8000/api/models/tiny_yolov4/predict
bash
curl -X POST "http://<Board_IP>:8000/api/models/tiny_yolov4/predict" \
  -F "file=@test.jpg"
EndpointMethodPurpose
/GETWeb preview UI
/api/models/tiny_yolov4/predictPOSTDetections (JSON)
/api/video_feedGETMJPEG 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_net std=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.