CV / YOLOX

YOLOX

reComputer R Series (CM5 + Hailo-8)

YOLOX COCO object detection on reComputer RK3576, RK3588, and CM5 with Hailo-8 or Hailo-10H.

246 downloads
Size
5.5 MB
Memory
4GB+
Precision
RKNN / Hailo HEF

Choose the device you're using, the set up guide and documentation will update accordingly.

Getting Started

Deploy
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.mp4

REST API

Use the REST API to run inference. Copy the commands below.

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

Model Details

reComputer R Series (CM5 + Hailo-8)

YOLOX on reComputer R Series (CM5 + Hailo-8)

The Hailo-8 YOLOX services provide COCO 80-class object detection with on-chip Hailo HPP NMS. The HEFs emit decoded post-NMS detections, while the FastAPI application provides image prediction, video and camera input, and an MJPEG preview.

Model information

VariantInputPackaged HEFContainer image
YOLOX-Tiny416×416×3 RGB5.5 MByolox_tiny
YOLOX-S-Leaky640×640×3 RGB9.0 MByolox_s_leaky
YOLOX-L-Leaky640×640×3 RGB53 MByolox_l_leaky

All three variants use Hailo Model Zoo v2.19.0 Hailo-8 HEFs and have been validated on CM5 with Hailo-8.

Hardware and host setup

ItemValue
BoardreComputer R Series with Raspberry Pi CM5
AcceleratorHailo-8 over PCIe, exposed as /dev/hailo0
RuntimeHailoRT 4.23.x
Python in container3.11, aarch64

The host driver, firmware, native HailoRT library, and Python wheel in the container must use the same HailoRT major and minor version.

bash
sudo apt update
sudo apt install hailo-all -y
sudo reboot

hailortcli fw-control identify
ls /dev/hailo0

Run with the demo video

YOLOX-Tiny

bash
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.mp4

YOLOX-S-Leaky

bash
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.mp4

YOLOX-L-Leaky

bash
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.mp4

Open http://<BOARD_IP>:8000 for the Web preview.

REST API

Each variant exposes a model-specific prediction route:

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

The response contains COCO class IDs, confidence scores, and bounding boxes.

Development

VariantSourceDockerfile
YOLOX-Tinysrc/rpi5_hailo8_yolox_tiny/docker/hailo8/yolox_tiny.dockerfile
YOLOX-S-Leakysrc/rpi5_hailo8_yolox_s_leaky/docker/hailo8/yolox_s_leaky.dockerfile
YOLOX-L-Leakysrc/rpi5_hailo8_yolox_l_leaky/docker/hailo8/yolox_l_leaky.dockerfile

Inputs and Outputs

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