Skip to main content

1Main Features Introduction

:::info 文档信息

页数:8 · 语言:英文

原始文档:Rockchip_Quick_Start_RKNN_Toolkit2_EN-1.2.0.pdf

:::

章节大纲​

  • 1Main Features Introduction(P4)
  • 2System Dependency Introduction(P4)
  • 3Ubuntu platform Quick Start Guide(P6)
    • 3.1Environment Preparation(P6)
    • 3.2Install RKNN-Toolkit2(Take Python3.6 as example)(P6)
    • 3.3Execute the example attached in the install packag(P7)
      • 3.3.1Simulate the running example on PC(P7)
  • 4Reference Document(P8)

在线预览​

若预览无法显示,请直接下载 PDF 后用本地阅读器打开。


3.1 Environment Preparation​

One x86_64 bit computer with ubuntu18.04 

One rk356x EVB board. 

Connect EVB to PC through OTG USB, use 'adb devices' command to check, and the result is as 

below:

The content marked in red is the device ID.

3.2 Install RKNN-Toolkit2(Take Python3.6 as example)​

  1. Install Python3.6 and pip3
sudo apt-get install python3 python3-dev python3-pip
  1. Install dependency
sudo apt-get install libxslt1-dev zlib1g zlib1g-dev libglib2.0-0 libsm6 \

libgl1-mesa-glx libprotobuf-dev gcc

  1. Obtain RKNN-Toolkit2 install package, and then execute below steps:

a) Install Python dependency:

pip3 install -r doc/requirements*.txt

b) Enter package directory:

cd package/

c) Install RKNN-Toolkit2

sudo pip3 install rknn_toolkit2*.whl

d) Check if RKNN-Toolkit2 is installed successfully or not

rk@rk:/rknn-toolkit2/package$ python3 >>> from rknn.api import RKNN >>> The installation is successful if the import of RKNN module doesn't fail. 3 Execute the example attached in the install package 3.1 Simulate the running example on PC RKNN-Toolkit2 has a built-in simulator which can be used to simulate the action of the model nning on npu. Here take mobilenet v1 as example. mobilenet v1 in the example is a Tensorflow Lite model, used _ _ r picture classification, and it is running on simulator. The running steps are as below: 1. Enter examples/lite/mobilenet v1 directory _ rk@rk:/rknn-toolkit2/package$ cd ../examples/lite/mobilenet v1 _ rk@rk:~/rknn-toolkit2/examples/lite/mobilenet v1$ _
rk@rk:~/rknn-toolkit2/package$ python3
>>> from rknn.api import RKNN
>>>
rk@rk:~/rknn-toolkit2/package$ cd ../examples/lite/mobilenet v1 _
rk@rk:~/rknn-toolkit2/examples/lite/mobilenet v1$
_
  1. Execute test.py script

rk@rk:~/rknn-toolkit2/examples/lite/mobilenet_v1$ python3 test.py

  1. Get the results after the script execution as below:

--> Config model done --> Loading model

done --> Building model Analysing : 100%|██████████████████████████████████████████████████| 58/58 [00:00<00:00, 229.97it/s] Quantizating : 100%|███████████████████████████████████████████████| 58/58 [00:00<00:00, 647.08it/s] I RKNN: librknnc version: x.x.x (xxxxxxxxxxxxxxx) I RKNN: set log level to 0 done --> Export RKNN model done --> Init runtime environment Preparing : 100%|███████████████████████████████████████████████████| 58/58 [00:02<00:00, 25.40it/s] W init runtime: target is None, use simulator! _ done --> Running model mobilenet v1 _ -----TOP 5----- [156]: 0.93310546875 [155]: 0.0555419921875 [205 284]: 0.003704071044921875 [205 284]: 0.003704071044921875 -1: 0.0 The main operations of this example include: create RKNN object, model configuration, load nsorFlow Lite model, structure RKNN model, export RKNN model, load pictures and infer to ge P5 result, release RKNN object. Other demos in the examples directory are executed the same way as mobilenet v1. These models _ e mainly used for classification, target detection.done
--> Building model
Analysing :
100%|██████████████████████████████████████████████████|
58/58 [00:00<00:00, 229.97it/s]
Quantizating :
100%|███████████████████████████████████████████████| 58/58
[00:00<00:00, 647.08it/s]
I RKNN: librknnc version: x.x.x (xxxxxxxxxxxxxxx)
I RKNN: set log level to 0
done
--> Export RKNN model
done
--> Init runtime environment
Preparing :
100%|███████████████████████████████████████████████████|
58/58 [00:02<00:00, 25.40it/s]
W init runtime: target is None, use simulator! _
done
--> Running model
mobilenet v1 _
-----TOP 5-----
[156]: 0.93310546875
[155]: 0.0555419921875
[205 284]: 0.003704071044921875
[205 284]: 0.003704071044921875
-1: 0.0

Reference Document​

For more detailed usage and interface descriptions of RKNN-Toolkit2, please refer to

<Rockchip_User_Guide_RKNN_Toolkit2_EN.pdf >.