CV / YOLOv6

YOLOv6

Select YOLOv6n, YOLOv6s, or YOLOv6m by changing the RKNN model path.

2 downloads
Precision
RKNN

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-yolov6:latest \
  python3 web_detection.py --platform rk3576 --model_path model/yolov6n.rknn --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": "yolov6-rknn",
  "messages": [{"role": "user", "content": "Hello"}]
}'
Python
import requests

resp = requests.post(
    "http://localhost:8080/v1/chat/completions",
    json={"model": "yolov6-rknn", "messages": [{"role": "user", "content": "Hello"}]},
)
print(resp.json())

Model Details

YOLOv6 on reComputer RK3576 and RK3588

This deployment is based on the YOLOv6 modules in reComputer-RK-CV. It runs COCO object detection with RKNN-Toolkit-Lite2 and provides browser preview, REST inference, and offline video processing.

Model information

PropertyValue
TaskCOCO 80-class object detection
Input640 x 640, letterboxed and converted from BGR to RGB
Variantsyolov6n.rknn, yolov6s.rknn, yolov6m.rknn
Defaultmodel/yolov6n.rknn
OutputClasses, confidence scores, and source-image boxes

Run the service

Select the model size by changing --model_path.

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-yolov6:latest \
  python3 web_detection.py --platform rk3576 \
  --model_path model/yolov6n.rknn --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-yolov6:latest \
  python3 web_detection.py --platform rk3588 \
  --model_path model/yolov6n.rknn --video_path video/test.mp4

Use model/yolov6s.rknn or model/yolov6m.rknn for the other catalog variants. Replace --video_path video/test.mp4 with --camera_id -1 for upload-only mode. Open http://<BOARD_IP>:8000 or /docs.

Startup arguments

ArgumentDefaultDescription
--platformRequiredrk3576 or rk3588; must match the image.
--model_pathRequiredOne of the packaged YOLOv6 RKNN files.
--camera_id1Camera index; -1 enables upload-only mode.
--video_pathNoneLooping local MP4; overrides the camera.
--class_pathCOCO labelsOptional replacement class list.
--host / --port0.0.0.0 / 8000FastAPI listen address and port.

REST API

Endpoint: POST /api/models/yolov6/predict

Fields include file, video, timestamp, realtime, conf (default 0.25), and iou (default 0.45).

bash
curl -X POST "http://<BOARD_IP>:8000/api/models/yolov6/predict" \
  -F "file=@bus.jpg" -F "conf=0.25" -F "iou=0.45"
bash
curl -X POST "http://<BOARD_IP>:8000/api/models/yolov6/predict" \
  -F "video=@test.mp4" -F "timestamp=5.5"

Example response:

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}
}

GET /api/config returns obj_thresh and nms_thresh. Update them with POST /api/config; request fields conf and iou override the global values.

The service also provides GET /api/health, GET /api/video_feed, POST /api/video/upload, POST /api/video/analyze, and video status, list, and download endpoints. Runtime files live under workspace/ unless RK_CV_WORKSPACE is set. Replacement models must retain the input size and YOLOv6 tensor layout expected by web_detection.py.

Build locally

bash
docker build -f docker/rk3576/yolov6.dockerfile \
  -t rk3576-yolov6:local src/rk3576_yolov6

docker build -f docker/rk3588/yolov6.dockerfile \
  -t rk3588-yolov6:local src/rk3588_yolov6

Inputs and Outputs

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