CV / YOLOX

YOLOX

reComputer R Series (CM5 + Hailo-8)

COCO-Objekterkennung mit YOLOX auf reComputer RK3576, RK3588 und CM5 mit Hailo-8 oder Hailo-10H.

241 Downloads
Größe
5.5 MB
Speicher
4GB+
Präzision
RKNN / Hailo HEF

Wähle das Gerät, das du verwendest. Die Einrichtungsanleitung und Dokumentation werden entsprechend aktualisiert.

Erste Schritte

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

REST API

Verwende die REST API für die Inferenz. Kopiere die folgenden Befehle.

Curl
curl http://localhost:8080/v1/chat/completions -d '{
  "model": "yolox-rknn",
  "messages": [{"role": "user", "content": "Hello"}]
}'
Python
import requests

resp = requests.post(
    "http://localhost:8080/v1/chat/completions",
    json={"model": "yolox-rknn", "messages": [{"role": "user", "content": "Hello"}]},
)
print(resp.json())

Modelldetails

reComputer R Series (CM5 + Hailo-8)

YOLOX auf reComputer R Series (CM5 + Hailo-8)

Die YOLOX-Dienste für Hailo-8 bieten COCO-Objekterkennung über 80 Klassen mit On-Chip-HPP-NMS. Die HEFs liefern bereits dekodierte Detektionen; die FastAPI-Anwendung bietet Bildinferenz, Video- und Kameraeingabe sowie eine MJPEG-Vorschau.

Modellinformationen

VarianteEingabeMitgeliefertes HEFContainer-Image
YOLOX-Tiny416x416x3 RGB5.5 MByolox_tiny
YOLOX-S-Leaky640x640x3 RGB9.0 MByolox_s_leaky
YOLOX-L-Leaky640x640x3 RGB53 MByolox_l_leaky

Alle drei Varianten nutzen Hailo-8-HEFs aus dem Model Zoo v2.19.0 und sind auf CM5 mit Hailo-8 validiert.

Hardware und Host-Setup

ElementWert
BoardreComputer R Series mit Raspberry Pi CM5
BeschleunigerHailo-8 über PCIe, verfügbar als /dev/hailo0
RuntimeHailoRT 4.23.x
Python im Container3.11, aarch64

Host-Treiber, Firmware, native HailoRT-Bibliothek und Python-Wheel im Container müssen dieselbe HailoRT-Major/Minor-Version verwenden.

bash
sudo apt update
sudo apt install hailo-all -y
sudo reboot

hailortcli fw-control identify
ls /dev/hailo0

Ausführung mit dem Demo-Video

YOLOX-Tiny

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

YOLOX-S-Leaky

bash
sudo docker run --rm --privileged --net=host \
  --name cm5-hailo8-yolox-s-leaky \
  -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/yolox_s_leaky:latest \
  python web_detection.py --model_path model/yolox_s_leaky.hef --video_path video/test.mp4

YOLOX-L-Leaky

bash
sudo docker run --rm --privileged --net=host \
  --name cm5-hailo8-yolox-l-leaky \
  -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/yolox_l_leaky:latest \
  python web_detection.py --model_path model/yolox_l_leaky.hef --video_path video/test.mp4

Öffnen Sie http://<BOARD_IP>:8000 für die Webvorschau.

REST API

Jede Variante stellt ihre eigene Vorhersage-Route bereit:

VarianteEndpunkt
YOLOX-TinyPOST /api/models/yolox_tiny/predict
YOLOX-S-LeakyPOST /api/models/yolox_s_leaky/predict
YOLOX-L-LeakyPOST /api/models/yolox_l_leaky/predict
bash
curl -X POST "http://<BOARD_IP>:8000/api/models/yolox_tiny/predict" \
  -F "file=@test.jpg"

Die Antwort enthält COCO-Klassen-IDs, Konfidenzen und Boxen.

Entwicklungshinweise

VarianteQuelleDockerfile
YOLOX-Tinysrc/rpi5_hailo8_yolox_tiny/docker/hailo8/yolox_tiny.dockerfile
YOLOX-S-Leakysrc/rpi5_hailo8_yolox_s_leaky/docker/hailo8/yolox_s_leaky.dockerfile
YOLOX-L-Leakysrc/rpi5_hailo8_yolox_l_leaky/docker/hailo8/yolox_l_leaky.dockerfile

Eingaben und Ausgaben

Input: image, video frame, or camera frame. Output: COCO classes, confidence scores, and boxes.