CV / YOLOX
YOLOX
reComputer R Series (CM5 + Hailo-8)
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-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.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-8)YOLOX sur reComputer R Series (CM5 + Hailo-8)
Les services YOLOX Hailo-8 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, et un aperçu MJPEG.
Informations du modèle
| Variante | Entrée | HEF fourni | Image du conteneur |
|---|---|---|---|
| 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 |
Les trois variantes utilisent des HEF Hailo-8 du Model Zoo v2.19.0 et sont validées sur CM5 avec Hailo-8.
Matériel et configuration de l'hôte
| Élément | Valeur |
|---|---|
| Carte | reComputer R Series avec Raspberry Pi CM5 |
| Accélérateur | Hailo-8 via PCIe, exposé comme /dev/hailo0 |
| Runtime | HailoRT 4.23.x |
| Python dans le conteneur | 3.11, 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-all -y
sudo reboot
hailortcli fw-control identify
ls /dev/hailo0Exécution avec la vidéo de démonstration
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.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/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 |
Entrées et sorties
Input: image, video frame, or camera frame. Output: COCO classes, confidence scores, and boxes.