CV / YOLOX

YOLOX

reComputer R Series (CM5 + Hailo-10H)

COCO-objectdetectie met YOLOX op reComputer RK3576, RK3588 en CM5 met Hailo-8 of Hailo-10H.

215 downloads
Grootte
5.5 MB
Geheugen
4GB+
Precisie
RKNN / Hailo HEF

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

Aan de slag

Implementeren
sudo docker run --rm \
  --name cm5-hailo10h-yolox-tiny \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo10h-cv/yolox_tiny:latest \
  python web_detection.py --model_path model/yolox_tiny.hef --video_path video/test.mp4

REST API

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

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())

Modeldetails

reComputer R Series (CM5 + Hailo-10H)

YOLOX op reComputer R Series (CM5 + Hailo-10H)

De YOLOX-services voor Hailo-10H bieden COCO-objectdetectie over 80 klassen met on-chip HPP NMS. De HEFs leveren al gedecodeerde detecties; de FastAPI-applicatie biedt beeldinferentie, video- en camera-invoer, een MJPEG-preview en offline video-analyse.

Modelinformatie

VariantInvoerMeegeleverde HEFContainer-image
YOLOX-Tiny416x416x3 RGB8,880,128 bytesyolox_tiny
YOLOX-S-Leaky640x640x3 RGB14,520,320 bytesyolox_s_leaky
YOLOX-L-Leaky640x640x3 RGB48,189,440 bytesyolox_l_leaky

Alle drie varianten gebruiken Hailo-10H HEFs uit Model Zoo v5.4.0 (bytegroottes staan in de tabel).

Hardware en hostinstellingen

OnderdeelWaarde
BoardreComputer R Series met Raspberry Pi CM5
VersnellerHailo-10H via PCIe, beschikbaar als /dev/hailo0
RuntimeHailoRT 5.1.1
Python in de container3.13, aarch64

Het hoststuurprogramma, de firmware, de native HailoRT-bibliotheek en de Python-wheel in de container moeten dezelfde HailoRT major/minor-versie hebben.

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

# Na herstart
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0

Uitvoeren met de demo-video

YOLOX-Tiny

bash
sudo docker run --rm --privileged --net=host \
  --name cm5-hailo10h-yolox-tiny \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo10h-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-hailo10h-yolox-s-leaky \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo10h-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-hailo10h-yolox-l-leaky \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.5.1.1:/usr/lib/libhailort.so.5.1.1:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo10h-cv/yolox_l_leaky:latest \
  python web_detection.py --model_path model/yolox_l_leaky.hef --video_path video/test.mp4

Open http://<BOARD_IP>:8000 voor de webpreview.

REST API

Elke variant heeft een eigen voorspellingsroute:

VariantEndpoint
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"

Het antwoord bevat COCO-klasse-ID's, confidences en boxen.

Ontwikkelnotities

VariantBronDockerfile
YOLOX-Tinysrc/hailo10h_yolox_tiny/docker/hailo10h/yolox_tiny.dockerfile
YOLOX-S-Leakysrc/hailo10h_yolox_s_leaky/docker/hailo10h/yolox_s_leaky.dockerfile
YOLOX-L-Leakysrc/hailo10h_yolox_l_leaky/docker/hailo10h/yolox_l_leaky.dockerfile

Invoer en uitvoer

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