CV / YOLOX
YOLOX
reComputer R Series (CM5 + Hailo-8)
COCO-objectdetectie met YOLOX op reComputer RK3576, RK3588 en CM5 met Hailo-8 of Hailo-10H.
Kies het apparaat dat je gebruikt. De installatiehandleiding en documentatie worden dienovereenkomstig bijgewerkt.
Aan de slag
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.mp4REST API
Gebruik de REST API om inferentie uit te voeren. Kopieer de onderstaande commando's.
curl http://localhost:8080/v1/chat/completions -d '{
"model": "yolox-rknn",
"messages": [{"role": "user", "content": "Hello"}]
}'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-8)YOLOX op reComputer R Series (CM5 + Hailo-8)
De YOLOX-services voor Hailo-8 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 en een MJPEG-preview.
Modelinformatie
| Variant | Invoer | Meegeleverde HEF | Container-image |
|---|---|---|---|
| YOLOX-Tiny | 416x416x3 RGB | 5.5 MB | yolox_tiny |
| YOLOX-S-Leaky | 640x640x3 RGB | 9.0 MB | yolox_s_leaky |
| YOLOX-L-Leaky | 640x640x3 RGB | 53 MB | yolox_l_leaky |
Alle drie varianten gebruiken Hailo-8 HEFs uit Model Zoo v2.19.0 en zijn gevalideerd op CM5 met Hailo-8.
Hardware en hostinstellingen
| Onderdeel | Waarde |
|---|---|
| Board | reComputer R Series met Raspberry Pi CM5 |
| Versneller | Hailo-8 via PCIe, beschikbaar als /dev/hailo0 |
| Runtime | HailoRT 4.23.x |
| Python in de container | 3.11, aarch64 |
Het hoststuurprogramma, de firmware, de native HailoRT-bibliotheek en de Python-wheel in de container moeten dezelfde HailoRT major/minor-versie hebben.
sudo apt update
sudo apt install hailo-all -y
sudo reboot
hailortcli fw-control identify
ls /dev/hailo0Uitvoeren met de demo-video
YOLOX-Tiny
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.mp4YOLOX-S-Leaky
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.mp4YOLOX-L-Leaky
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.mp4Open http://<BOARD_IP>:8000 voor de webpreview.
REST API
Elke variant heeft een eigen voorspellingsroute:
| Variant | Endpoint |
|---|---|
| YOLOX-Tiny | POST /api/models/yolox_tiny/predict |
| YOLOX-S-Leaky | POST /api/models/yolox_s_leaky/predict |
| YOLOX-L-Leaky | POST /api/models/yolox_l_leaky/predict |
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
| Variant | Bron | Dockerfile |
|---|---|---|
| YOLOX-Tiny | src/rpi5_hailo8_yolox_tiny/ | docker/hailo8/yolox_tiny.dockerfile |
| YOLOX-S-Leaky | src/rpi5_hailo8_yolox_s_leaky/ | docker/hailo8/yolox_s_leaky.dockerfile |
| YOLOX-L-Leaky | src/rpi5_hailo8_yolox_l_leaky/ | docker/hailo8/yolox_l_leaky.dockerfile |
Invoer en uitvoer
Input: image, video frame, or camera frame. Output: COCO classes, confidence scores, and boxes.