CV / YOLOX
YOLOX
reComputer R Series (CM5 + Hailo-10H)
Detección de objetos COCO con YOLOX en reComputer RK3576, RK3588 y CM5 con Hailo-8 o Hailo-10H.
Elige el dispositivo que estás usando. La guía de configuración y la documentación se actualizarán en consecuencia.
Primeros pasos
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
Usa la API REST para ejecutar inferencia. Copia los comandos siguientes.
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())Detalles del modelo
reComputer R Series (CM5 + Hailo-10H)YOLOX en reComputer R Series (CM5 + Hailo-10H)
Los servicios YOLOX de Hailo-10H ofrecen detección de objetos COCO de 80 clases con NMS HPP en chip. Los HEF entregan detecciones ya decodificadas y la aplicación FastAPI ofrece predicción de imágenes, entrada de vídeo y cámara, vista previa MJPEG y análisis de vídeo offline.
Información del modelo
| Variante | Entrada | HEF incluido | Imagen del contenedor |
|---|---|---|---|
| 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 |
Las tres variantes usan HEF de Hailo-10H del Model Zoo v5.4.0 (los tamaños en bytes están en la tabla).
Hardware y configuración del host
| Elemento | Valor |
|---|---|
| Placa | reComputer R Series con Raspberry Pi CM5 |
| Acelerador | Hailo-10H por PCIe, expuesto como /dev/hailo0 |
| Runtime | HailoRT 5.1.1 |
| Python en el contenedor | 3.13, aarch64 |
El driver del host, el firmware, la librería nativa HailoRT y el wheel de Python del contenedor deben compartir la misma versión mayor y menor de HailoRT.
sudo apt update
sudo apt install hailo-h10-all -y
sudo reboot
# Después de reiniciar
hailortcli --version
hailortcli fw-control identify
ls -l /dev/hailo0Ejecución con el vídeo de demostración
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.mp4Abre http://<BOARD_IP>:8000 para ver la vista previa web.
REST API
Cada variante expone su propia ruta de predicción:
| 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 respuesta contiene IDs de clase COCO, confidencias y cajas.
Notas de desarrollo
| Variante | Código | 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 |
Entradas y salidas
Input: image, video frame, or camera frame. Output: COCO classes, confidence scores, and boxes.