CV / YOLOv8

YOLOv8-cls

YOLOv8-cls scores one image against the 1000 ImageNet classes and returns the ranked result. Start a prebuilt Docker image with one command and run inference through the REST API on RK3576 and RK3588. The guide covers device setup and troubleshooting.

Precision
INT8
Inference Engine
RKNN
Image input size
224x224

Start right away with Seeed Products

Platform
Size
Precision
  1. Install Docker

    bash
    bash <(curl -fsSL https://get.docker.com)

    Armbian 26.8.7 Gnome or newer with OTA overlayroot: Configure Docker storage before running containers to avoid overlay mount errors.

  2. Run the Docker command

    bash
    sudo docker run --rm \
      --name yolov8n-cls-rk3588-int8 \
      --privileged \
      -p 8000:8000 \
      -v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
      ghcr.io/seeed-projects/recomputer-rk-cv/yolov8n-cls:rk3588-int8

Check that it’s running

Open the address below in a browser. Replace <rk3588-ip> with your board’s IP address.

http://<rk3588-ip>:8000

If you see the detection stream with boxes around objects, you’re all set.

Deploy on hardware you already have

Platform
Size
Precision

RK3588

You can also run these models on other RK3588 boards. Examples include Radxa ROCK 5B, FriendlyELEC NanoPC-T6, Orange Pi 5 Plus, and Banana Pi BPI-M7.

  1. Check the RKNPU driver version

    bash
    sudo cat /sys/kernel/debug/rknpu/version

    If the version is older than v0.9.8, install the latest supported OS image for your board or upgrade to a kernel your board vendor provides with v0.9.8 or later. Reboot and check the version again.

  2. Install Docker

    bash
    bash <(curl -fsSL https://get.docker.com)
  3. Run the Docker command

    If a device path on your board differs from the command below, update the host path before running it.

    bash
    sudo docker run --rm \
      --name yolov8n-cls-rk3588-int8 \
      --privileged \
      -p 8000:8000 \
      -v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
      ghcr.io/seeed-projects/recomputer-rk-cv/yolov8n-cls:rk3588-int8

Check that it’s running

Open the address below in a browser. Replace <rk3588-ip> with your board’s IP address.

http://<rk3588-ip>:8000

If you see the detection stream with boxes around objects, you’re all set.

RESTful API

API endpoints

MethodPathPurpose
POST/api/predictClassify an uploaded image against the 1000 ImageNet classes.
GET/api/metadataRead the model task, labels, input size, and result fields.
GET/api/configRead the current inference thresholds.
POST/api/configUpdate the inference thresholds.
GET/api/video_feedStream annotated video as MJPEG.
GET/api/healthCheck model and runtime status.

Prediction accepts multipart form data. Use file for an image, video and an optional timestamp in seconds for a video frame, or no upload to use the latest live frame. Optional conf and iou values range from 0 to 1. To update the default thresholds, send JSON with obj_thresh and nms_thresh to POST /api/config.

Each image serves one size and precision; switch the size and precision options in Getting Started to run another build on the same board.

Test the API

Replace <board-ip> with your board's IP address. Save an image as test.jpg in your current directory and send it to the prediction endpoint.

bash
curl --fail-with-body \
  -F "file=@test.jpg" \
  "http://<board-ip>:8000/api/predict"

Read classification for the ranked class IDs, names, and scores. The first entry is the model's best guess.

Develop with the API

Install requests with python -m pip install requests. In the example, replace <board-ip> with your board's IP address and use an image named test.jpg.

python
import requests

with open("test.jpg", "rb") as image:
    response = requests.post(
        "http://<board-ip>:8000/api/predict",
        files={"file": image},
        timeout=30,
    )
response.raise_for_status()
print(response.json())

Frequently Asked Questions (FAQ)

Why do some sizes disappear when I switch platforms?

The size picker shows the variants with a deployment command for your selected platform. Switch platforms in the quick start to see the sizes available for each one.

What should I check if the accelerator is unavailable?

Check that the host OS, drivers, and runtime match the selected platform’s guide. For Hailo, verify that the host detects the accelerator and that the installed HailoRT version matches the deployment instructions.

Where do I find the inference endpoint?

Select your platform and open the RESTful API section for the endpoint and input format.

More FAQs