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.

246 téléchargements
Taille
5.5 MB
Mémoire
4GB+
Précision
RKNN / Hailo HEF

Choisissez l'appareil que vous utilisez. Le guide de configuration et la documentation seront mis à jour en conséquence.

Pour commencer

Déployer
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

API REST

Utilisez l'API REST pour exécuter l'inférence. Copiez les commandes ci-dessous.

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

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

VarianteEntréeHEF fourniImage du conteneur
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

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émentValeur
CartereComputer R Series avec Raspberry Pi CM5
AccélérateurHailo-10H via PCIe, exposé comme /dev/hailo0
RuntimeHailoRT 5.1.1
Python dans le conteneur3.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.

bash
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/hailo0

Exécution avec la vidéo de démonstration

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

Ouvrez http://<BOARD_IP>:8000 pour afficher l'aperçu web.

REST API

Chaque variante expose sa propre route de prédiction :

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

La réponse contient les IDs de classe COCO, les confidences et les boîtes.

Notes de développement

VarianteSourceDockerfile
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

Entrées et sorties

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