Skip to content

Commit 333f951

Browse files
author
Randall Zhuo
committed
Update rknn_model_zoo to V2.2.0. Support more examples, such as mobilesam wav2wav etc.
Signed-off-by: Randall Zhuo <randall.zhuo@rock-chips.com>
1 parent c2b7d00 commit 333f951

99 files changed

Lines changed: 56261 additions & 160434 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*.log
66
*.pyc
77
*.zip
8-
*.npy
8+
#*.npy
99
*.pkl
1010
*.pb
1111

39.5 KB
Binary file not shown.
24.8 KB
Binary file not shown.
36.3 KB
Binary file not shown.
12.9 KB
Binary file not shown.
12 KB
Binary file not shown.
56.2 KB
Binary file not shown.

3rdparty/rknpu2/include/rknn_matmul_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ typedef struct rknn_matmul_info_t
197197
*/
198198
int rknn_matmul_create(rknn_matmul_ctx* ctx, rknn_matmul_info* info, rknn_matmul_io_attr* io_attr);
199199

200-
/* rknn_matmul_create_dyn_shape
200+
/* rknn_matmul_create_dynamic_shape
201201
202202
params:
203203
rknn_matmul_ctx *ctx the handle of context.
@@ -211,7 +211,7 @@ int rknn_matmul_create(rknn_matmul_ctx* ctx, rknn_matmul_info* info, rknn_matmul
211211
/*
212212
原来的info.M, K, N无效
213213
*/
214-
int rknn_matmul_create_dyn_shape(rknn_matmul_ctx* ctx, rknn_matmul_info* info, int shape_num,
214+
int rknn_matmul_create_dynamic_shape(rknn_matmul_ctx* ctx, rknn_matmul_info* info, int shape_num,
215215
rknn_matmul_shape dynamic_shapes[], rknn_matmul_io_attr io_attrs[]);
216216

217217
/* rknn_matmul_set_io_mem

FAQ.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
| ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
2828
| Platform | RV1109<br />RV1126<br />RK1808<br />RK3399pro | RV1103<br />RV1106<br />RK3562<br />RK3566<br />RK3568<br />RK3588<br />RK3576 |
2929
| Driver | Upgrade by replace .ko file | Upgrade by burning new firmware |
30-
| Runtime | Refer to the [documentation](https://github.com/airockchip/rknpu/blob/master/README.md) and replace **librknn_runtime.so** and its related dependency files to upgrade.<br /><br />(PC-to-board debugging function requires updating the **rknn_server** file described in the document) | Refer to [Document](https://github.com/rockchip-linux/rknn-toolkit2/blob/master/doc/rknn_server_proxy.md), replace the **librknnrt.so** file to upgrade<br />(RV1103/RV1106 use the cropped version runtime, the corresponding file name is **librknnmrt.so**)<br /><br />(PC-to-board debugging function requires updating the **rknn_server** file described in the document) |
31-
| RKNN-Toolkit | Refer to the [documentation](https://github.com/airockchip/rknn-toolkit/blob/master/README.md) to install the new python whl file for upgrade | Refer to the [documentation](https://github.com/rockchip-linux/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V1.6.0_EN.pdf) **Chapter 2.1** to install the new python whl file for upgrade |
30+
| Runtime | Refer to the [documentation](https://github.com/airockchip/rknpu/blob/master/README.md) and replace **librknn_runtime.so** and its related dependency files to upgrade.<br /><br />(PC-to-board debugging function requires updating the **rknn_server** file described in the document) | Refer to [Document](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/rknn_server_proxy.md), replace the **librknnrt.so** file to upgrade<br />(RV1103/RV1106 use the cropped version runtime, the corresponding file name is **librknnmrt.so**)<br /><br />(PC-to-board debugging function requires updating the **rknn_server** file described in the document) |
31+
| RKNN-Toolkit | Refer to the [documentation](https://github.com/airockchip/rknn-toolkit/blob/master/README.md) to install the new python whl file for upgrade | Refer to the [documentation](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.2.0_EN.pdf) **Chapter 2.1** to install the new python whl file for upgrade |
3232

3333
- Please note that due to differences in specifications of development boards, firmware is usually incompatible with each other. Please contact the source of purchase to obtain new firmware and burning methods.
3434

@@ -61,21 +61,21 @@ The following factors may cause differences in inference performance:
6161
- The inference performance data of rknn model zoo does **not include pre-processing and post-processing**. It only counts the time-consuming of **rknn.run**, which is different from the time-consuming of the complete demo. The time-consuming of these other operations is related to usage scenarios and system resource occupancy.
6262
- Whether the board has been **fixed frequency and reached the maximum frequency** set by [scaling_frequency.sh](./scaling_frequency.sh). Some firmware may limit the maximum frequency of the CPU/NPU/DDR, resulting in reduced inference performance.
6363
- Whether there are other applications occupying **CPU/NPU and bandwidth resources**, which will cause the inference performance to be lower.
64-
- For chips with both big and small core CPUs (currently RK3588, RK3576), please refer to [document](https://github.com/rockchip-linux/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V1.6.0_EN.pdf) Chapter 5.3.3, **bind the big CPU core for testing**.
64+
- For chips with both big and small core CPUs (currently RK3588, RK3576), please refer to [document](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.2.0_EN.pdf) Chapter 5.3.3, **bind the big CPU core for testing**.
6565

6666

6767

6868
### 1.6 How to solve the accuracy problem after model quantization
6969

70-
Please refer to the [userguide document](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V1.6.0_CN.pdf) to confirm whether the quantization function is used correctly.
70+
Please refer to the [userguide document](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.2.0_EN.pdf) to confirm whether the quantization function is used correctly.
7171

7272
If the **model structural** characteristics and **weight distribution** cause int8 quantization to lose accuracy, please consider using **hybrid quantization** or **QAT quantization**.
7373

7474

7575

7676
### 1.7 Is there a board-side python demo
7777

78-
Install **RKNN-Toolkit-lite** on the board end and use the python inference script corresponding to the demo to implement python inference on the board. For RKNPU1 devices, refer to [RKNN-Toolkit-lite](https://github.com/airockchip/rknn-toolkit/tree/master/rknn-toolkit-lite). For RKNPU2 devices, refer to [RKNN-Toolkit-lite2](https://github.com/airockchip/rknn-toolkit2/tree/master/rknn_toolkit_lite2).
78+
Install **RKNN-Toolkit-lite** on the board end and use the python inference script corresponding to the demo to implement python inference on the board. For RKNPU1 devices, refer to [RKNN-Toolkit-lite](https://github.com/airockchip/rknn-toolkit/tree/master/rknn-toolkit-lite). For RKNPU2 devices, refer to [RKNN-Toolkit-lite2](https://github.com/airockchip/rknn-toolkit2/tree/master/rknn-toolkit-lite2).
7979

8080
(Some examples currently lack python demo. In addition, it is recommended that users who care about performance use the C interface for deployment)
8181

FAQ_CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
| ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
2828
| 对应平台 | RV1109<br />RV1126<br />RK1808<br />RK3399pro | RV1103<br />RV1106<br />RK3562<br />RK3566<br />RK3568<br />RK3588<br />RK3576 |
2929
| 驱动 | 通过更新.ko文件升级 | 通过更新固件升级 |
30-
| runtime | 参考[文档](https://github.com/airockchip/rknpu/blob/master/README.md),替换 librknn_runtime.so 及其相关依赖文件升级<br />(如果需要使用python连板调试功能,请同步更新文档中涉及的 rknn_server 文件) | 参考[文档](https://github.com/rockchip-linux/rknn-toolkit2/blob/master/doc/rknn_server_proxy.md),替换 librknnrt.so 文件升级<br />(RV1103/RV1106 使用裁剪版本的 runtime,对应文件名称为 librknnmrt.so)<br />(如果需要使用 python 连板调试功能,请同步更新文档中涉及的 rknn_server 文件) |
31-
| RKNN-Toolkit | 参考[文档](https://github.com/airockchip/rknn-toolkit/blob/master/README.md),安装新的 python whl 文件升级 | 参考[文档](https://github.com/rockchip-linux/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V1.6.0_CN.pdf) 2.1小节,安装新的 python whl 文件升级 |
30+
| runtime | 参考[文档](https://github.com/airockchip/rknpu/blob/master/README.md),替换 librknn_runtime.so 及其相关依赖文件升级<br />(如果需要使用python连板调试功能,请同步更新文档中涉及的 rknn_server 文件) | 参考[文档](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/rknn_server_proxy.md),替换 librknnrt.so 文件升级<br />(RV1103/RV1106 使用裁剪版本的 runtime,对应文件名称为 librknnmrt.so)<br />(如果需要使用 python 连板调试功能,请同步更新文档中涉及的 rknn_server 文件) |
31+
| RKNN-Toolkit | 参考[文档](https://github.com/airockchip/rknn-toolkit/blob/master/README.md),安装新的 python whl 文件升级 | 参考[文档](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.2.0_CN.pdf) 2.1小节,安装新的 python whl 文件升级 |
3232

3333
- 请注意,由于开发板的规格差异,固件通常是互不兼容的,请联系开发板的购买来源获取新固件及烧录方法。
3434

@@ -61,21 +61,21 @@
6161
- rknn model zoo 的推理性能数据不包含前后处理,只统计 rknn.run 的耗时,与完整demo的耗时是存在差异的。这些操作的耗时与使用场景、系统资源占用有关,这部分数据请用户基于实际环境进行测试。
6262
- 板子是否已经定频、并且达到了[定频脚本](./scaling_frequency.sh)设定的最高频率。部分固件可能限制了CPU/NPU/DDR的最高频率,导致推理性能有所减弱。
6363
- 是否有其他应用占用了 CPU/NPU 及带宽资源,这会导致推理性能减弱。
64-
- 对于有大小核CPU的芯片(目前为RK3588, RK3576),测试时请参考[文档](https://github.com/rockchip-linux/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V1.6.0_CN.pdf)的5.3.3小节,绑定CPU大核进行测试。
64+
- 对于有大小核CPU的芯片(目前为RK3588, RK3576),测试时请参考[文档](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.2.0_CN.pdf)的5.3.3小节,绑定CPU大核进行测试。
6565

6666

6767

6868
### 1.6 如何解决模型量化掉精度问题
6969

70-
根据平台版本,先参考 [RKNN-Toolkit1文档](https://github.com/airockchip/rknn-toolkit/blob/master/doc/Rockchip_User_Guide_RKNN_Toolkit_V1.7.5_CN.pdf)[RKNN-Toolkit2文档](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V1.6.0_CN.pdf) 确认量化功能的使用是否正确。
70+
根据平台版本,先参考 [RKNN-Toolkit1文档](https://github.com/airockchip/rknn-toolkit/blob/master/doc/Rockchip_User_Guide_RKNN_Toolkit_V1.7.5_CN.pdf)[RKNN-Toolkit2文档](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.2.0_CN.pdf) 确认量化功能的使用是否正确。
7171

7272
如果是模型结构特性、权重分布导致 int8 量化掉精度,请考虑使用混合量化或QAT量化。
7373

7474

7575

7676
### 1.7 是否有板端 python demo
7777

78-
在板端安装 RKNN-Toolkit-lite,使用对应 demo 的 python 推理脚本,将 `from rknn.api import RKNN` 修改为 `from rknnlite.api import RKNNLite as RKNN` 就可以实现板端的 python 推理。RKNPU1 平台请使用 [RKNN-Toolkit-lite](https://github.com/airockchip/rknn-toolkit/tree/master/rknn-toolkit-lite),RKNPU2 平台请使用 [RKNN-Toolkit-lite2](https://github.com/airockchip/rknn-toolkit2/tree/master/rknn_toolkit_lite2)
78+
在板端安装 RKNN-Toolkit-lite,使用对应 demo 的 python 推理脚本,将 `from rknn.api import RKNN` 修改为 `from rknnlite.api import RKNNLite as RKNN` 就可以实现板端的 python 推理。RKNPU1 平台请使用 [RKNN-Toolkit-lite](https://github.com/airockchip/rknn-toolkit/tree/master/rknn-toolkit-lite),RKNPU2 平台请使用 [RKNN-Toolkit-lite2](https://github.com/airockchip/rknn-toolkit2/tree/master/rknn-toolkit-lite2)
7979

8080
(部份示例目前暂缺 python demo,此外更推荐在意性能的用户使用C接口进行部署)
8181

0 commit comments

Comments
 (0)