Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge2:npu:demos:rknn-tflite

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
products:sbc:edge2:npu:demos:rknn-tflite [2023/10/23 03:08]
sravan created
products:sbc:edge2:npu:demos:rknn-tflite [2025/06/06 03:24] (current)
louis
Line 1: Line 1:
-====== TFLite Edge2 Demo - ======+====== TFLite Edge2 Demo - 11 ======
 We can run TFLite models by converting them into RKNN format and running them on the onboard NPU. We can run TFLite models by converting them into RKNN format and running them on the onboard NPU.
 +
 +{{indexmenu_n>11}}
  
 ===== Get Source code ===== ===== Get Source code =====
Line 17: Line 19:
 After you have cloned the source code: After you have cloned the source code:
  
-==== get the necessary system packages ====+==== Get the necessary system packages ====
 ```shell ```shell
 $ sudo apt-get install git python3 python3-dev python3-pip $ sudo apt-get install git python3 python3-dev python3-pip
Line 27: Line 29:
 $ git clone https://github.com/rockchip-linux/rknn-toolkit2 $ git clone https://github.com/rockchip-linux/rknn-toolkit2
 $ cd rknn-toolkit2 $ cd rknn-toolkit2
-$ git checkout f29bfee21066a35a0a6b789208b630144735acd4+$ git checkout b25dadacc24b88eb7dfcaa47c9c525ecca89b319
 ``` ```
  
Line 47: Line 49:
 and run the command accordingly and run the command accordingly
 | python version | command | | python version | command |
 +| 3.11 | ''version=cp311'' |
 | 3.10 | ''version=cp310'' | | 3.10 | ''version=cp310'' |
 +| 3.9 | ''version=cp39'' |
 | 3.8 | ''version=cp38'' | | 3.8 | ''version=cp38'' |
 +| 3.7 | ''version=cp37'' |
 | 3.6 | ''version=cp36'' | | 3.6 | ''version=cp36'' |
  
 ==== Install the requirements ==== ==== Install the requirements ====
 ```shell ```shell
-$ pip3 install -r doc/requirements_$version-*.txt+$ pip3 install -r rknn-toolkit2/packages/requirements_$version-*.txt
 ``` ```
  
 ==== Install the appropriate toolkit wheel ==== ==== Install the appropriate toolkit wheel ====
 ```shell ```shell
-$ pip3 install packages/rknn_toolkit2-*-$version-$version-linux_x86_64.whl +$ pip3 install rknn-toolkit2/packages/rknn_toolkit2-*-$version-$version-linux_x86_64.whl 
-$ ../+cd ../
 ``` ```
  
Line 85: Line 90:
 ==== Install necessary python packages ==== ==== Install necessary python packages ====
 ```shell ```shell
-$ pip3 install numpy pillow+$ pip3 install numpy pillow opencv-python librosa sounddevice
 ``` ```
  
Line 92: Line 97:
 $ git clone https://github.com/rockchip-linux/rknn-toolkit2 $ git clone https://github.com/rockchip-linux/rknn-toolkit2
 $ cd rknn-toolkit2 $ cd rknn-toolkit2
-$ git checkout f29bfee21066a35a0a6b789208b630144735acd4+$ git checkout b25dadacc24b88eb7dfcaa47c9c525ecca89b319
 ``` ```
  
Line 103: Line 108:
 | 3.11 | ''version=cp311'' | | 3.11 | ''version=cp311'' |
 | 3.10 | ''version=cp310'' | | 3.10 | ''version=cp310'' |
 +| 3.9 | ''version=cp39'' |
 | 3.8 | ''version=cp38'' | | 3.8 | ''version=cp38'' |
 +| 3.7 | ''version=cp37'' |
 | 3.6 | ''version=cp36'' | | 3.6 | ''version=cp36'' |
  
Line 109: Line 116:
 ```shell ```shell
 $ pip3 install rknn_toolkit_lite2/packages/rknn_toolkit_lite2-*-$version-$version-linux_aarch64.whl $ pip3 install rknn_toolkit_lite2/packages/rknn_toolkit_lite2-*-$version-$version-linux_aarch64.whl
-$ cd ../../ 
-``` 
- 
-==== Clone the RKNPU library ==== 
-```shell 
-$ git clone https://github.com/rockchip-linux/rknpu2/ 
-$ cd rknpu2 
-$ git checkout f29bfee21066a35a0a6b789208b630144735acd4 
 ``` ```
  
 ==== Copy the runtime library ==== ==== Copy the runtime library ====
 ```shell ```shell
-$ sudo cp runtime/RK3588/Linux/librknn_api/aarch64/librknnrt.so /usr/lib/+$ sudo cp rknpu2/runtime/Linux/librknn_api/aarch64/librknnrt.so /usr/lib/
 $ cd ../ $ cd ../
 ``` ```
 +
  
 ===== Run Examples ===== ===== Run Examples =====
Last modified: 2023/10/23 03:08 by sravan