CV / YOLOX
YOLOX
reComputer R Series (CM5 + Hailo-10H)
Détection d’objets COCO avec YOLOX sur reComputer RK3576, RK3588 et CM5 avec Hailo-8 ou Hailo-10H.
Choisissez l'appareil que vous utilisez. Le guide de configuration et la documentation seront mis à jour en conséquence.
Pour commencer
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.mp4API REST
Utilisez l'API REST pour exécuter l'inférence. Copiez les commandes ci-dessous.
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())Détails du modèle
reComputer R Series (CM5 + Hailo-10H)YOLOX sur reComputer R Series (CM5 + Hailo-10H)
Les services YOLOX Hailo-10H offrent la détection d'objets COCO en 80 classes avec NMS HPP embarqué. Les HEF fournissent des détections déjà décodées et l'application FastAPI propose la prédiction d'images, l'entrée vidéo et caméra, un aperçu MJPEG et l'analyse vidéo hors ligne.
Informations du modèle
| Variante | Entrée | HEF fourni | Image du conteneur |
|---|---|---|---|
| YOLOX-Tiny | 416x416x3 RGB | 8,880,128 bytes | yolox_tiny |
| YOLOX-S-Leaky | 640x640x3 RGB | 14,520,320 bytes | yolox_s_leaky |
| YOLOX-L-Leaky | 640x640x3 RGB | 48,189,440 bytes | yolox_l_leaky |
Les trois variantes utilisent des HEF Hailo-10H du Model Zoo v5.4.0 (tailles en octets dans le tableau).
Matériel et configuration de l'hôte
| Élément | Valeur |
|---|---|
| Carte | reComputer R Series avec Raspberry Pi CM5 |
| Accélérateur | Hailo-10H via PCIe, exposé comme /dev/hailo0 |
| Runtime | HailoRT 5.1.1 |
| Python dans le conteneur | 3.13, aarch64 |
Le pilote de l'hôte, le firmware, la bibliothèque native HailoRT et le wheel Python du conteneur doivent partager la même version majeure et mineure de HailoRT.
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot
# Après redémarrage
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0Exécution avec la vidéo de démonstration
YOLOX-Tiny
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.mp4YOLOX-S-Leaky
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.mp4YOLOX-L-Leaky
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.mp4Ouvrez http://<BOARD_IP>:8000 pour afficher l'aperçu web.
REST API
Chaque variante expose sa propre route de prédiction :
| Variante | 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"La réponse contient les IDs de classe COCO, les confidences et les boîtes.
Notes de développement
| Variante | Source | Dockerfile |
|---|---|---|
| YOLOX-Tiny | src/hailo10h_yolox_tiny/ | docker/hailo10h/yolox_tiny.dockerfile |
| YOLOX-S-Leaky | src/hailo10h_yolox_s_leaky/ | docker/hailo10h/yolox_s_leaky.dockerfile |
| YOLOX-L-Leaky | src/hailo10h_yolox_l_leaky/ | docker/hailo10h/yolox_l_leaky.dockerfile |
Entrées et sorties
Input: image, video frame, or camera frame. Output: COCO classes, confidence scores, and boxes.