CV / YOLOX

YOLOX

Select an RKNN YOLOX-S/M model or a Hailo-8 Tiny/S-Leaky/L-Leaky HEF for the target platform.

5 downloads
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 --privileged --net=host --device /dev/dri/renderD128:/dev/dri/renderD128 \
  -v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
  ghcr.io/seeed-projects/recomputer-rk-cv/rk3576-yolox:latest \
  python3 web_detection.py --platform rk3576 --model_path model/yolox_s.rknn \
  --class_path model/coco_80_labels_list.txt --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 RK

YOLOX on reComputer RK3576 and RK3588

This page is based on the YOLOX services in reComputer-RK-CV. The runtime performs RKNN inference, YOLOX branch decoding, objectness/class-score fusion, and class-aware NMS.

Model information

PropertyValue
TaskCOCO 80-class object detection
Input640 x 640 letterboxed RGB
Variantsyolox_s.rknn, yolox_m.rknn
Defaultmodel/yolox_s.rknn
Labelsmodel/coco_80_labels_list.txt

Run the service

RK3576

bash
sudo docker run --rm --privileged --net=host \
  --device /dev/dri/renderD128:/dev/dri/renderD128 \
  -v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
  ghcr.io/seeed-projects/recomputer-rk-cv/rk3576-yolox:latest \
  python3 web_detection.py --platform rk3576 \
  --model_path model/yolox_s.rknn \
  --class_path model/coco_80_labels_list.txt --video_path video/test.mp4

RK3588

bash
sudo docker run --rm --privileged --net=host \
  --device /dev/dri/renderD128:/dev/dri/renderD128 \
  -v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
  ghcr.io/seeed-projects/recomputer-rk-cv/rk3588-yolox:latest \
  python3 web_detection.py --platform rk3588 \
  --model_path model/yolox_s.rknn \
  --class_path model/coco_80_labels_list.txt --video_path video/test.mp4

Use model/yolox_m.rknn for the medium variant. Keep the class-path argument when switching models. Open http://<BOARD_IP>:8000 or /docs.

Startup arguments

ArgumentDefaultDescription
--platformRequiredrk3576 or rk3588.
--model_pathRequiredYOLOX-S or YOLOX-M RKNN file.
--class_pathRequired by the packaged commandCOCO class-name file.
--camera_id1Camera index; -1 enables uploads only.
--video_pathNoneLooping local MP4; overrides the camera.
--host / --port0.0.0.0 / 8000Service address and port.

REST API

Endpoint: POST /api/models/yolox/predict

bash
curl -X POST "http://<BOARD_IP>:8000/api/models/yolox/predict" \
  -F "file=@bus.jpg" -F "conf=0.25" -F "iou=0.45"
json
{
  "success": true,
  "source": "uploaded image",
  "predictions": [
    {
      "class": "bus",
      "confidence": 0.91,
      "box": {"x1": 100, "y1": 120, "x2": 520, "y2": 430}
    }
  ],
  "image": {"width": 640, "height": 480}
}

The service accepts image, uploaded-video frame, and current-source requests. GET/POST /api/config controls obj_thresh and nms_thresh; request-level conf and iou override them. Health, MJPEG, video upload, asynchronous analysis, status, list, and download endpoints are also available.

Input is letterboxed, converted to RGB, decoded by branch, and processed with objectness/class-score fusion and class-aware NMS. Replacement models must match this included YOLOX decoder and class configuration.

Build locally

bash
docker build -f docker/rk3576/yolox.dockerfile \
  -t rk3576-yolox:local src/rk3576_yolox

docker build -f docker/rk3588/yolox.dockerfile \
  -t rk3588-yolox:local src/rk3588_yolox

Inputs and Outputs

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