Skip to main content

RKNN Quick Example

tip

This document is intended to demonstrate how to run the official example, for more information please see RKNN Toolkit2 doc directory.

Install dependencies

X86 Linux PC
sudo apt install git python-is-python3 python3-pip libxslt1-dev zlib1g-dev libglib2.0-dev libsm6 libgl1-mesa-glx libprotobuf-dev build-essential adb

Download and installing RKNN Toolkit2

X86 Linux PC
git clone -b v2.3.0 https://github.com/airockchip/rknn-toolkit2.git
cd rknn-toolkit2/rknn-toolkit2/packages/x86_64/
pip3 install -r requirements_cp38-2.3.0.txt
pip3 install ./rknn_toolkit2-2.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Run the yolov5 example

X86 Linux PC
cd examples/onnx/yolov5
python test.py
info

After the conversion model and inference script test.py is run successfully, the converted model is saved in examples/onnx/yolov5/yolov5s_relu.rknn by default, and the result of the inference image is saved in examples/onnx/yolov5/result.jpg

inference result