csukuangfj
commited on
Commit
·
477da44
1
Parent(s):
1d3636a
first commit
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +11 -0
- CHANGELOG.md +152 -0
- LICENSE +5 -0
- README.md +84 -0
- autosparsity/README.md +58 -0
- autosparsity/examples/README.md +68 -0
- autosparsity/examples/autosparsity.py +17 -0
- autosparsity/examples/datasets.txt +1 -0
- autosparsity/examples/dog_224x224.jpg +3 -0
- autosparsity/examples/labels.txt +1000 -0
- autosparsity/examples/resnet50.onnx +3 -0
- autosparsity/examples/test.py +81 -0
- autosparsity/packages/autosparsity-1.0-cp310-cp310-linux_x86_64.whl +3 -0
- autosparsity/packages/autosparsity-1.0-cp311-cp311-linux_x86_64.whl +3 -0
- autosparsity/packages/autosparsity-1.0-cp36-cp36m-linux_x86_64.whl +3 -0
- autosparsity/packages/autosparsity-1.0-cp37-cp37m-linux_x86_64.whl +3 -0
- autosparsity/packages/autosparsity-1.0-cp38-cp38-linux_x86_64.whl +3 -0
- autosparsity/packages/autosparsity-1.0-cp39-cp39-linux_x86_64.whl +3 -0
- doc/01_Rockchip_RK2118_Quick_Start_RKNN_SDK_V2.1.0_CN.pdf +3 -0
- doc/01_Rockchip_RK2118_Quick_Start_RKNN_SDK_V2.1.0_EN.pdf +3 -0
- doc/01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.1.0_CN.pdf +3 -0
- doc/01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.1.0_EN.pdf +3 -0
- doc/01_Rockchip_RV1106_RV1103_Quick_Start_RKNN_SDK_V2.1.0_CN.pdf +3 -0
- doc/01_Rockchip_RV1106_RV1103_Quick_Start_RKNN_SDK_V2.1.0_EN.pdf +3 -0
- doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.1.0_CN.pdf +3 -0
- doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.1.0_EN.pdf +3 -0
- doc/03_Rockchip_RKNPU_API_Reference_RKNN_Toolkit2_V2.1.0_CN.pdf +3 -0
- doc/03_Rockchip_RKNPU_API_Reference_RKNN_Toolkit2_V2.1.0_EN.pdf +3 -0
- doc/04_Rockchip_RKNPU_API_Reference_RKNNRT_V2.1.0_CN.pdf +3 -0
- doc/04_Rockchip_RKNPU_API_Reference_RKNNRT_V2.1.0_EN.pdf +3 -0
- doc/05_RKNN_Compiler_Support_Operator_List_V2.1.0.pdf +3 -0
- doc/RKNNToolKit2_OP_Support-v2.1.0.md +519 -0
- doc/Using RKNN-ToolKit2 in WSL.md +63 -0
- doc/WSL中使用RKNN_ToolKit2.md +63 -0
- doc/rknn_server_proxy.md +349 -0
- res/QQGroup2QRCode.png +3 -0
- res/QQGroup3QRCode.png +3 -0
- res/QQGroupQRCode.png +3 -0
- res/framework.png +3 -0
- res/logo.png +3 -0
- rknn-toolkit-lite2/CHANGELOG.txt +45 -0
- rknn-toolkit-lite2/examples/dynamic_shape/README.md +49 -0
- rknn-toolkit-lite2/examples/dynamic_shape/dog_224x224.jpg +3 -0
- rknn-toolkit-lite2/examples/dynamic_shape/mobilenet_v2_for_rk3562.rknn +3 -0
- rknn-toolkit-lite2/examples/dynamic_shape/mobilenet_v2_for_rk3566_rk3568.rknn +3 -0
- rknn-toolkit-lite2/examples/dynamic_shape/mobilenet_v2_for_rk3576.rknn +3 -0
- rknn-toolkit-lite2/examples/dynamic_shape/mobilenet_v2_for_rk3588.rknn +3 -0
- rknn-toolkit-lite2/examples/dynamic_shape/synset_label.py +1003 -0
- rknn-toolkit-lite2/examples/dynamic_shape/test.py +135 -0
- rknn-toolkit-lite2/examples/resnet18/README.md +34 -0
.gitattributes
CHANGED
@@ -33,3 +33,14 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
37 |
+
*.whl filter=lfs diff=lfs merge=lfs -text
|
38 |
+
*.pdf filter=lfs diff=lfs merge=lfs -text
|
39 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
40 |
+
*.rknn filter=lfs diff=lfs merge=lfs -text
|
41 |
+
*.caffemodel filter=lfs diff=lfs merge=lfs -text
|
42 |
+
*.JPEG filter=lfs diff=lfs merge=lfs -text
|
43 |
+
*.so filter=lfs diff=lfs merge=lfs -text
|
44 |
+
*.so.* filter=lfs diff=lfs merge=lfs -text
|
45 |
+
*.a filter=lfs diff=lfs merge=lfs -text
|
46 |
+
opencv_version filter=lfs diff=lfs merge=lfs -text
|
CHANGELOG.md
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# CHANGELOG
|
2 |
+
|
3 |
+
## v2.1.0
|
4 |
+
|
5 |
+
- Support RV1103B (Beta)
|
6 |
+
- Support RK2118 (Beta)
|
7 |
+
- Support Flash Attention (Only RK3562 and RK3576)
|
8 |
+
- Improve MatMul API
|
9 |
+
- Improve support for int32 and int64
|
10 |
+
- Support more operators and operator fusion
|
11 |
+
|
12 |
+
## v2.0.0-beta0
|
13 |
+
|
14 |
+
- Support RK3576 (Beta)
|
15 |
+
- Support RK2118 (Beta)
|
16 |
+
- Support SDPA (Scaled Dot Product Attention) to improve transformer performance
|
17 |
+
- Improve custom operators support
|
18 |
+
- Improve MatMul API
|
19 |
+
- Improve support for Reshape,Transpose,BatchLayernorm,Softmax,Deconv,Matmul,ScatterND etc.
|
20 |
+
- Support pytorch 2.1
|
21 |
+
- Improve support for QAT models of pytorch and onnx
|
22 |
+
- Optimize automatic generation of C++ code
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
## v1.6.0
|
27 |
+
|
28 |
+
- Support ONNX model of OPSET 12~19
|
29 |
+
- Support custom operators (including CPU and GPU)
|
30 |
+
- Improve support for dynamic weight convolution, Layernorm, RoiAlign, Softmax, ReduceL2, Gelu, GLU, etc.
|
31 |
+
- Added support for python3.7/3.9/3.11
|
32 |
+
- Add rknn_convert function
|
33 |
+
- Improve transformer support
|
34 |
+
- Improve MatMul API, such as increasing the K limit length, RK3588 adding int4 * int4 -> int16 support, etc.
|
35 |
+
- Reduce RV1106 rknn_init initialization time, memory consumption, etc.
|
36 |
+
- RV1106 adds int16 support for some operators
|
37 |
+
- Fixed the problem that the convolution operator of RV1106 platform may make random errors in some cases.
|
38 |
+
- Improve user manual
|
39 |
+
- Reconstruct the rknn model zoo and add support for multiple models such as detection, segmentation, OCR, and license plate recognition.
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
## v1.5.2
|
44 |
+
|
45 |
+
- Improve dynamic shape support
|
46 |
+
- Improve matmul api support
|
47 |
+
- Add GPU back-end implementations for some operators such as matmul
|
48 |
+
- Improve transformer support
|
49 |
+
- Reduce rknn_init memory usage
|
50 |
+
- Optimize rknn_init time-consuming
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
## v1.5.0
|
55 |
+
|
56 |
+
- Support RK3562
|
57 |
+
- Support more NPU operator fuse, such as Conv-Silu/Conv-Swish/Conv-Hardswish/Conv-sigmoid/Conv-HardSwish/Conv-Gelu ..
|
58 |
+
- Improve support for NHWC output layout
|
59 |
+
- RK3568/RK3588:The maximum input resolution up to 8192
|
60 |
+
- Improve support for Swish/DataConvert/Softmax/Lstm/LayerNorm/Gather/Transpose/Mul/Maxpool/Sigmoid/Pad
|
61 |
+
- Improve support for CPU operators (Cast, Sin, Cos, RMSNorm, ScalerND, GRU)
|
62 |
+
- Limited support for dynamic resolution
|
63 |
+
- Provide MATMUL API
|
64 |
+
- Add RV1103/RV1106 rknn_server application as proxy between PC and board
|
65 |
+
- Add more examples such as rknn_dynamic_shape_input_demo and video demo for yolov5
|
66 |
+
- Bug fix
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
## v1.4.0
|
71 |
+
|
72 |
+
- Support more NPU operators, such as Reshape、Transpose、MatMul、 Max、Min、exGelu、exSoftmax13、Resize etc.
|
73 |
+
|
74 |
+
- Add **Weight Share** function, reduce memory usage.
|
75 |
+
|
76 |
+
- Add **Weight Compression** function, reduce memory and bandwidth usage.(RK3588/RV1103/RV1106)
|
77 |
+
|
78 |
+
- RK3588 supports storing weights or feature maps on SRAM, reducing system bandwidth consumption.
|
79 |
+
|
80 |
+
- RK3588 adds the function of running a single model on multiple cores at the same time.
|
81 |
+
|
82 |
+
- Add new output layout NHWC (C has alignment restrictions) .
|
83 |
+
|
84 |
+
- Improve support for non-4D input.
|
85 |
+
|
86 |
+
- Add more examples such as rknn_yolov5_android_apk_demo and rknn_internal_mem_reuse_demo.
|
87 |
+
|
88 |
+
- Bug fix.
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
## v1.3.0
|
93 |
+
|
94 |
+
- Support RV1103/RV1106(Beta SDK)
|
95 |
+
- rknn_tensor_attr support w_stride(rename from stride) and h_stride
|
96 |
+
- Rename rknn_destroy_mem()
|
97 |
+
- Support more NPU operators, such as Where, Resize, Pad, Reshape, Transpose etc.
|
98 |
+
- RK3588 support multi-batch multi-core mode
|
99 |
+
- When RKNN_LOG_LEVEL=4, it supports to display the MACs utilization and bandwidth occupation of each layer.
|
100 |
+
- Bug fix
|
101 |
+
|
102 |
+
|
103 |
+
|
104 |
+
## v1.2.0
|
105 |
+
|
106 |
+
- Support RK3588
|
107 |
+
- Support more operators, such as GRU、Swish、LayerNorm etc.
|
108 |
+
- Reduce memory usage
|
109 |
+
- Improve zero-copy interface implementation
|
110 |
+
- Bug fix
|
111 |
+
|
112 |
+
|
113 |
+
|
114 |
+
## v1.1.0
|
115 |
+
|
116 |
+
- Support INT8+FP16 mixed quantization to improve model accuracy
|
117 |
+
- Support specifying input and output dtype, which can be solidified into the model
|
118 |
+
- Support multiple inputs of the model with different channel mean/std
|
119 |
+
- Improve the stability of multi-thread + multi-process runtime
|
120 |
+
- Support flashing cache for fd pointed to internal tensor memory which are allocated by users
|
121 |
+
- Improve dumping internal layer results of the model
|
122 |
+
- Add rknn_server application as proxy between PC and board
|
123 |
+
- Support more operators, such as HardSigmoid、HardSwish、Gather、ReduceMax、Elu
|
124 |
+
- Add LSTM support (structure cifg and peephole are not supported, function: layernormal, clip is not supported)
|
125 |
+
- Bug fix
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
## v1.0
|
130 |
+
|
131 |
+
- Optimize the performance of rknn_inputs_set()
|
132 |
+
- Add more functions for zero-copy
|
133 |
+
- Add new OP support, see OP support list document for details.
|
134 |
+
- Add multi-process support
|
135 |
+
- Support per-channel quantitative model
|
136 |
+
- Bug fix
|
137 |
+
|
138 |
+
|
139 |
+
|
140 |
+
## v0.7
|
141 |
+
|
142 |
+
- Optimize the performance of rknn_inputs_set(), especially for models whose input width is 8-byte aligned.
|
143 |
+
|
144 |
+
- Add new OP support, see OP support list document for details.
|
145 |
+
|
146 |
+
- Bug fix
|
147 |
+
|
148 |
+
|
149 |
+
|
150 |
+
## v0.6
|
151 |
+
- Initial version
|
152 |
+
|
LICENSE
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**Copyright Statement**
|
2 |
+
|
3 |
+
Copyright(C) 2024 Rockchip Electronics Co., Ltd. All rights reserved.
|
4 |
+
|
5 |
+
BY OPENING OR USING THIS FILE, RECEIVER HEREBY ACKNOWLEDGES AND AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("ROCKCHIP SOFTWARE") RECEIVED FROM ROCKCHIP ON AN "AS-IS" BASIS ONLY WITHOUT ANY AND ALL WARRANTIES, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OR CONDITION WITH RESPECT TO TITLE, MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. NEITHER DOES ROCKCHIP PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO ANY OPEN SOURCE TECHNOLOGIES, THIRD-PARTY TECHNOLOGIES OR ANY STANDARD TECHNOLOGIES WHICH MAY BE SUPPORTED BY, INCORPORATED IN, OR SUPPLIED WITH THE ROCKCHIP SOFTWARE. RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN AND MAINTAIN ALL NECESSARY LICENSES AND RIGHTS FROM THEIR RESPECTIVE OWNERS TO USE ANY SUCH THIRD-PARTY TECHNOLOGIES OR ANY STANDARD TECHNOLOGIES. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND ROCKCHIP'S ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE ROCKCHIP SOFTWARE RELEASED HEREUNDER WILL BE, AT ROCKCHIP 'S OPTION, TO REVISE OR REPLACE THE ROCKCHIP SOFTWARE AT ISSUE, OR REFUND ANY FEES OR CHARGE PAID BY RECEIVER TO ROCKCHIP FOR SUCH ROCKCHIP SOFTWARE AT ISSUE.
|
README.md
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Description
|
2 |
+
RKNN software stack can help users to quickly deploy AI models to Rockchip chips. The overall framework is as follows:
|
3 |
+
<center class="half">
|
4 |
+
<div style="background-color:#ffffff;">
|
5 |
+
<img src="res/framework.png" title="RKNN"/>
|
6 |
+
</center>
|
7 |
+
|
8 |
+
In order to use RKNPU, users need to first run the RKNN-Toolkit2 tool on the computer, convert the trained model into an RKNN format model, and then inference on the development board using the RKNN C API or Python API.
|
9 |
+
|
10 |
+
- RKNN-Toolkit2 is a software development kit for users to perform model conversion, inference and performance evaluation on PC and Rockchip NPU platforms.
|
11 |
+
|
12 |
+
- RKNN-Toolkit-Lite2 provides Python programming interfaces for Rockchip NPU platform to help users deploy RKNN models and accelerate the implementation of AI applications.
|
13 |
+
|
14 |
+
- RKNN Runtime provides C/C++ programming interfaces for Rockchip NPU platform to help users deploy RKNN models and accelerate the implementation of AI applications.
|
15 |
+
|
16 |
+
- RKNPU kernel driver is responsible for interacting with NPU hardware. It has been open source and can be found in the Rockchip kernel code.
|
17 |
+
|
18 |
+
# Support Platform
|
19 |
+
- RK3588 Series
|
20 |
+
- RK3576 Series
|
21 |
+
- RK3566/RK3568 Series
|
22 |
+
- RK3562 Series
|
23 |
+
- RV1103/RV1106
|
24 |
+
- RV1103B
|
25 |
+
- RK2118
|
26 |
+
|
27 |
+
|
28 |
+
Note:
|
29 |
+
|
30 |
+
**For RK1808/RV1109/RV1126/RK3399Pro, please refer to :**
|
31 |
+
|
32 |
+
https://github.com/airockchip/rknn-toolkit
|
33 |
+
|
34 |
+
https://github.com/airockchip/rknpu
|
35 |
+
|
36 |
+
https://github.com/airockchip/RK3399Pro_npu
|
37 |
+
|
38 |
+
|
39 |
+
# Download
|
40 |
+
- You can also download all packages, docker image, examples, docs and platform-tools from [RKNPU2_SDK](https://console.zbox.filez.com/l/I00fc3), fetch code: rknn
|
41 |
+
- You can get more examples from [rknn mode zoo](https://github.com/airockchip/rknn_model_zoo)
|
42 |
+
|
43 |
+
# Notes
|
44 |
+
- RKNN-Toolkit2 is not compatible with [RKNN-Toolkit](https://github.com/airockchip/rknn-toolkit)
|
45 |
+
- Currently only support on:
|
46 |
+
- Ubuntu 18.04 python 3.6/3.7
|
47 |
+
- Ubuntu 20.04 python 3.8/3.9
|
48 |
+
- Ubuntu 22.04 python 3.10/3.11
|
49 |
+
- Latest version:v2.1.0
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
# RKNN LLM
|
54 |
+
|
55 |
+
If you want to deploy LLM (Large Language Model), we have introduced a new SDK called RKNN-LLM. For details, please refer to:
|
56 |
+
|
57 |
+
https://github.com/airockchip/rknn-llm
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
# CHANGELOG
|
62 |
+
|
63 |
+
## v2.1.0
|
64 |
+
- Support RV1103B (Beta)
|
65 |
+
- Support RK2118 (Beta)
|
66 |
+
- Support Flash Attention (Only RK3562 and RK3576)
|
67 |
+
- Improve MatMul API
|
68 |
+
- Improve support for int32 and int64
|
69 |
+
- Support more operators and operator fusion
|
70 |
+
|
71 |
+
for older version, please refer [CHANGELOG](CHANGELOG.md)
|
72 |
+
|
73 |
+
# Feedback and Community Support
|
74 |
+
- [Redmine](https://redmine.rock-chips.com) (**Feedback recommended, Please consult our sales or FAE for the redmine account**)
|
75 |
+
- QQ Group Chat: 1025468710 (full, please join group 3)
|
76 |
+
- QQ Group Chat2: 547021958 (full, please join group 3)
|
77 |
+
- QQ Group Chat3: 469385426
|
78 |
+
<center class="half">
|
79 |
+
<img width="200" height="200" src="res/QQGroupQRCode.png" title="QQ Group Chat"/>
|
80 |
+
<img width="200" height="200" src="res/QQGroup2QRCode.png" title="QQ Group Chat2"/>
|
81 |
+
<img width="200" height="200" src="res/QQGroup3QRCode.png" title="QQ Group Chat3"/>
|
82 |
+
</center>
|
83 |
+
|
84 |
+
|
autosparsity/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## AutoSparsity
|
2 |
+
|
3 |
+
Enables sparse training and inference for PyTorch models.
|
4 |
+
|
5 |
+
|
6 |
+
## Usage
|
7 |
+
|
8 |
+
### Step 1
|
9 |
+
|
10 |
+
Install autosparsity package
|
11 |
+
|
12 |
+
```bash
|
13 |
+
pip install packages/autosparsity-1.0-cp38-cp38m-linux_x86_64.whl
|
14 |
+
```
|
15 |
+
|
16 |
+
### Step 2
|
17 |
+
|
18 |
+
Taking ResNet50 in torchvision as an example to generate the sparse model.
|
19 |
+
|
20 |
+
```bash
|
21 |
+
python examples/autosparsity.py
|
22 |
+
```
|
23 |
+
To sparsity a custom model, just add the sparsity_model functionwhen model training, as follows:
|
24 |
+
|
25 |
+
```python
|
26 |
+
# insert model autosparsity code before training
|
27 |
+
import torch
|
28 |
+
import torchvision.models as models
|
29 |
+
from autosparsity.sparsity import sparsity_model
|
30 |
+
|
31 |
+
...
|
32 |
+
|
33 |
+
model = models.resnet34(pretrained=True).cuda()
|
34 |
+
mode = 0
|
35 |
+
sparsity_model(model, optimizer, mode)
|
36 |
+
|
37 |
+
# normal training
|
38 |
+
x, y = DataLoader(args)
|
39 |
+
for epoch in range(epochs):
|
40 |
+
y_pred = model(x)
|
41 |
+
loss = loss_func(y_pred, y)
|
42 |
+
loss.backward()
|
43 |
+
optimizer.step()
|
44 |
+
...
|
45 |
+
```
|
46 |
+
|
47 |
+
- Note: Make sure CUDA is available
|
48 |
+
|
49 |
+
|
50 |
+
### Step3
|
51 |
+
|
52 |
+
Use RKNN-Toolkite to perfom sparse inference
|
53 |
+
|
54 |
+
```bash
|
55 |
+
python examples/test.py
|
56 |
+
```
|
57 |
+
- Note: Only supports RK3576 target platform
|
58 |
+
|
autosparsity/examples/README.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Sparse Infer
|
2 |
+
|
3 |
+
This tool is used for the Torch model to autosparsity the weights during the training, which can save model storage and reduce model inference time in RKNN sparse inference.
|
4 |
+
|
5 |
+
## Usage
|
6 |
+
|
7 |
+
### Step 1
|
8 |
+
|
9 |
+
Install autosparsity package
|
10 |
+
|
11 |
+
```bash
|
12 |
+
pip install ../packages/autosparsity-1.0-cp38-cp38m-linux_x86_64.whl
|
13 |
+
```
|
14 |
+
|
15 |
+
### Step 2
|
16 |
+
|
17 |
+
Taking ResNet50 in torchvision as an example to generate the sparse model.
|
18 |
+
|
19 |
+
```bash
|
20 |
+
python autosparsity.py
|
21 |
+
```
|
22 |
+
To sparsity a custom model, just add the sparsity_model functionwhen model training, as follows:
|
23 |
+
|
24 |
+
```python
|
25 |
+
# insert model autosparsity code before training
|
26 |
+
import torch
|
27 |
+
import torchvision.models as models
|
28 |
+
from autosparsity.sparsity import sparsity_model
|
29 |
+
|
30 |
+
...
|
31 |
+
|
32 |
+
model = models.resnet34(pretrained=True).cuda()
|
33 |
+
mode = 0
|
34 |
+
sparsity_model(model, optimizer, mode)
|
35 |
+
|
36 |
+
# normal training
|
37 |
+
x, y = DataLoader(args)
|
38 |
+
for epoch in range(epochs):
|
39 |
+
y_pred = model(x)
|
40 |
+
loss = loss_func(y_pred, y)
|
41 |
+
loss.backward()
|
42 |
+
optimizer.step()
|
43 |
+
...
|
44 |
+
```
|
45 |
+
|
46 |
+
- Note: Make sure CUDA is available
|
47 |
+
|
48 |
+
|
49 |
+
### Step3
|
50 |
+
|
51 |
+
Perfom sparse inference
|
52 |
+
|
53 |
+
```bash
|
54 |
+
python test.py
|
55 |
+
```
|
56 |
+
- Note: Only supports RK3576 target platform
|
57 |
+
|
58 |
+
### Expected Results:
|
59 |
+
|
60 |
+
This will print the , as follows:
|
61 |
+
```
|
62 |
+
-----TOP 5-----
|
63 |
+
[155] score:0.877372 class:"Shih-Tzu"
|
64 |
+
[283] score:0.042477 class:"Persian cat"
|
65 |
+
[ 82] score:0.006625 class:"ruffed grouse, partridge, Bonasa umbellus"
|
66 |
+
[154] score:0.006625 class:"Pekinese, Pekingese, Peke"
|
67 |
+
[204] score:0.004696 class:"Lhasa, Lhasa apso"
|
68 |
+
```
|
autosparsity/examples/autosparsity.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
import torchvision.models as models
|
3 |
+
from autosparsity.sparsity import sparsity_model
|
4 |
+
|
5 |
+
|
6 |
+
if __name__ == "__main__":
|
7 |
+
|
8 |
+
model = models.resnet50(pretrained=True).cuda()
|
9 |
+
optimizer = None
|
10 |
+
mode = 0
|
11 |
+
sparsity_model(model, optimizer, mode)
|
12 |
+
|
13 |
+
model.eval()
|
14 |
+
x = torch.randn((1,3,224,224)).cuda()
|
15 |
+
torch.onnx.export(
|
16 |
+
model, x, 'resnet50.onnx', input_names=['inputs'], output_names=['outputs']
|
17 |
+
)
|
autosparsity/examples/datasets.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
./dog_224x224.jpg
|
autosparsity/examples/dog_224x224.jpg
ADDED
![]() |
Git LFS Details
|
autosparsity/examples/labels.txt
ADDED
@@ -0,0 +1,1000 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
0:tench, Tinca tinca
|
2 |
+
1:goldfish, Carassius auratus
|
3 |
+
2:great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias
|
4 |
+
3:tiger shark, Galeocerdo cuvieri
|
5 |
+
4:hammerhead, hammerhead shark
|
6 |
+
5:electric ray, crampfish, numbfish, torpedo
|
7 |
+
6:stingray
|
8 |
+
7:cock
|
9 |
+
8:hen
|
10 |
+
9:ostrich, Struthio camelus
|
11 |
+
10:brambling, Fringilla montifringilla
|
12 |
+
11:goldfinch, Carduelis carduelis
|
13 |
+
12:house finch, linnet, Carpodacus mexicanus
|
14 |
+
13:junco, snowbird
|
15 |
+
14:indigo bunting, indigo finch, indigo bird, Passerina cyanea
|
16 |
+
15:robin, American robin, Turdus migratorius
|
17 |
+
16:bulbul
|
18 |
+
17:jay
|
19 |
+
18:magpie
|
20 |
+
19:chickadee
|
21 |
+
20:water ouzel, dipper
|
22 |
+
21:kite
|
23 |
+
22:bald eagle, American eagle, Haliaeetus leucocephalus
|
24 |
+
23:vulture
|
25 |
+
24:great grey owl, great gray owl, Strix nebulosa
|
26 |
+
25:European fire salamander, Salamandra salamandra
|
27 |
+
26:common newt, Triturus vulgaris
|
28 |
+
27:eft
|
29 |
+
28:spotted salamander, Ambystoma maculatum
|
30 |
+
29:axolotl, mud puppy, Ambystoma mexicanum
|
31 |
+
30:bullfrog, Rana catesbeiana
|
32 |
+
31:tree frog, tree-frog
|
33 |
+
32:tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui
|
34 |
+
33:loggerhead, loggerhead turtle, Caretta caretta
|
35 |
+
34:leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea
|
36 |
+
35:mud turtle
|
37 |
+
36:terrapin
|
38 |
+
37:box turtle, box tortoise
|
39 |
+
38:banded gecko
|
40 |
+
39:common iguana, iguana, Iguana iguana
|
41 |
+
40:American chameleon, anole, Anolis carolinensis
|
42 |
+
41:whiptail, whiptail lizard
|
43 |
+
42:agama
|
44 |
+
43:frilled lizard, Chlamydosaurus kingi
|
45 |
+
44:alligator lizard
|
46 |
+
45:Gila monster, Heloderma suspectum
|
47 |
+
46:green lizard, Lacerta viridis
|
48 |
+
47:African chameleon, Chamaeleo chamaeleon
|
49 |
+
48:Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis
|
50 |
+
49:African crocodile, Nile crocodile, Crocodylus niloticus
|
51 |
+
50:American alligator, Alligator mississipiensis
|
52 |
+
51:triceratops
|
53 |
+
52:thunder snake, worm snake, Carphophis amoenus
|
54 |
+
53:ringneck snake, ring-necked snake, ring snake
|
55 |
+
54:hognose snake, puff adder, sand viper
|
56 |
+
55:green snake, grass snake
|
57 |
+
56:king snake, kingsnake
|
58 |
+
57:garter snake, grass snake
|
59 |
+
58:water snake
|
60 |
+
59:vine snake
|
61 |
+
60:night snake, Hypsiglena torquata
|
62 |
+
61:boa constrictor, Constrictor constrictor
|
63 |
+
62:rock python, rock snake, Python sebae
|
64 |
+
63:Indian cobra, Naja naja
|
65 |
+
64:green mamba
|
66 |
+
65:sea snake
|
67 |
+
66:horned viper, cerastes, sand viper, horned asp, Cerastes cornutus
|
68 |
+
67:diamondback, diamondback rattlesnake, Crotalus adamanteus
|
69 |
+
68:sidewinder, horned rattlesnake, Crotalus cerastes
|
70 |
+
69:trilobite
|
71 |
+
70:harvestman, daddy longlegs, Phalangium opilio
|
72 |
+
71:scorpion
|
73 |
+
72:black and gold garden spider, Argiope aurantia
|
74 |
+
73:barn spider, Araneus cavaticus
|
75 |
+
74:garden spider, Aranea diademata
|
76 |
+
75:black widow, Latrodectus mactans
|
77 |
+
76:tarantula
|
78 |
+
77:wolf spider, hunting spider
|
79 |
+
78:tick
|
80 |
+
79:centipede
|
81 |
+
80:black grouse
|
82 |
+
81:ptarmigan
|
83 |
+
82:ruffed grouse, partridge, Bonasa umbellus
|
84 |
+
83:prairie chicken, prairie grouse, prairie fowl
|
85 |
+
84:peacock
|
86 |
+
85:quail
|
87 |
+
86:partridge
|
88 |
+
87:African grey, African gray, Psittacus erithacus
|
89 |
+
88:macaw
|
90 |
+
89:sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita
|
91 |
+
90:lorikeet
|
92 |
+
91:coucal
|
93 |
+
92:bee eater
|
94 |
+
93:hornbill
|
95 |
+
94:hummingbird
|
96 |
+
95:jacamar
|
97 |
+
96:toucan
|
98 |
+
97:drake
|
99 |
+
98:red-breasted merganser, Mergus serrator
|
100 |
+
99:goose
|
101 |
+
100:black swan, Cygnus atratus
|
102 |
+
101:tusker
|
103 |
+
102:echidna, spiny anteater, anteater
|
104 |
+
103:platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus
|
105 |
+
104:wallaby, brush kangaroo
|
106 |
+
105:koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus
|
107 |
+
106:wombat
|
108 |
+
107:jellyfish
|
109 |
+
108:sea anemone, anemone
|
110 |
+
109:brain coral
|
111 |
+
110:flatworm, platyhelminth
|
112 |
+
111:nematode, nematode worm, roundworm
|
113 |
+
112:conch
|
114 |
+
113:snail
|
115 |
+
114:slug
|
116 |
+
115:sea slug, nudibranch
|
117 |
+
116:chiton, coat-of-mail shell, sea cradle, polyplacophore
|
118 |
+
117:chambered nautilus, pearly nautilus, nautilus
|
119 |
+
118:Dungeness crab, Cancer magister
|
120 |
+
119:rock crab, Cancer irroratus
|
121 |
+
120:fiddler crab
|
122 |
+
121:king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica
|
123 |
+
122:American lobster, Northern lobster, Maine lobster, Homarus americanus
|
124 |
+
123:spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish
|
125 |
+
124:crayfish, crawfish, crawdad, crawdaddy
|
126 |
+
125:hermit crab
|
127 |
+
126:isopod
|
128 |
+
127:white stork, Ciconia ciconia
|
129 |
+
128:black stork, Ciconia nigra
|
130 |
+
129:spoonbill
|
131 |
+
130:flamingo
|
132 |
+
131:little blue heron, Egretta caerulea
|
133 |
+
132:American egret, great white heron, Egretta albus
|
134 |
+
133:bittern
|
135 |
+
134:crane
|
136 |
+
135:limpkin, Aramus pictus
|
137 |
+
136:European gallinule, Porphyrio porphyrio
|
138 |
+
137:American coot, marsh hen, mud hen, water hen, Fulica americana
|
139 |
+
138:bustard
|
140 |
+
139:ruddy turnstone, Arenaria interpres
|
141 |
+
140:red-backed sandpiper, dunlin, Erolia alpina
|
142 |
+
141:redshank, Tringa totanus
|
143 |
+
142:dowitcher
|
144 |
+
143:oystercatcher, oyster catcher
|
145 |
+
144:pelican
|
146 |
+
145:king penguin, Aptenodytes patagonica
|
147 |
+
146:albatross, mollymawk
|
148 |
+
147:grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus
|
149 |
+
148:killer whale, killer, orca, grampus, sea wolf, Orcinus orca
|
150 |
+
149:dugong, Dugong dugon
|
151 |
+
150:sea lion
|
152 |
+
151:Chihuahua
|
153 |
+
152:Japanese spaniel
|
154 |
+
153:Maltese dog, Maltese terrier, Maltese
|
155 |
+
154:Pekinese, Pekingese, Peke
|
156 |
+
155:Shih-Tzu
|
157 |
+
156:Blenheim spaniel
|
158 |
+
157:papillon
|
159 |
+
158:toy terrier
|
160 |
+
159:Rhodesian ridgeback
|
161 |
+
160:Afghan hound, Afghan
|
162 |
+
161:basset, basset hound
|
163 |
+
162:beagle
|
164 |
+
163:bloodhound, sleuthhound
|
165 |
+
164:bluetick
|
166 |
+
165:black-and-tan coonhound
|
167 |
+
166:Walker hound, Walker foxhound
|
168 |
+
167:English foxhound
|
169 |
+
168:redbone
|
170 |
+
169:borzoi, Russian wolfhound
|
171 |
+
170:Irish wolfhound
|
172 |
+
171:Italian greyhound
|
173 |
+
172:whippet
|
174 |
+
173:Ibizan hound, Ibizan Podenco
|
175 |
+
174:Norwegian elkhound, elkhound
|
176 |
+
175:otterhound, otter hound
|
177 |
+
176:Saluki, gazelle hound
|
178 |
+
177:Scottish deerhound, deerhound
|
179 |
+
178:Weimaraner
|
180 |
+
179:Staffordshire bullterrier, Staffordshire bull terrier
|
181 |
+
180:American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier
|
182 |
+
181:Bedlington terrier
|
183 |
+
182:Border terrier
|
184 |
+
183:Kerry blue terrier
|
185 |
+
184:Irish terrier
|
186 |
+
185:Norfolk terrier
|
187 |
+
186:Norwich terrier
|
188 |
+
187:Yorkshire terrier
|
189 |
+
188:wire-haired fox terrier
|
190 |
+
189:Lakeland terrier
|
191 |
+
190:Sealyham terrier, Sealyham
|
192 |
+
191:Airedale, Airedale terrier
|
193 |
+
192:cairn, cairn terrier
|
194 |
+
193:Australian terrier
|
195 |
+
194:Dandie Dinmont, Dandie Dinmont terrier
|
196 |
+
195:Boston bull, Boston terrier
|
197 |
+
196:miniature schnauzer
|
198 |
+
197:giant schnauzer
|
199 |
+
198:standard schnauzer
|
200 |
+
199:Scotch terrier, Scottish terrier, Scottie
|
201 |
+
200:Tibetan terrier, chrysanthemum dog
|
202 |
+
201:silky terrier, Sydney silky
|
203 |
+
202:soft-coated wheaten terrier
|
204 |
+
203:West Highland white terrier
|
205 |
+
204:Lhasa, Lhasa apso
|
206 |
+
205:flat-coated retriever
|
207 |
+
206:curly-coated retriever
|
208 |
+
207:golden retriever
|
209 |
+
208:Labrador retriever
|
210 |
+
209:Chesapeake Bay retriever
|
211 |
+
210:German short-haired pointer
|
212 |
+
211:vizsla, Hungarian pointer
|
213 |
+
212:English setter
|
214 |
+
213:Irish setter, red setter
|
215 |
+
214:Gordon setter
|
216 |
+
215:Brittany spaniel
|
217 |
+
216:clumber, clumber spaniel
|
218 |
+
217:English springer, English springer spaniel
|
219 |
+
218:Welsh springer spaniel
|
220 |
+
219:cocker spaniel, English cocker spaniel, cocker
|
221 |
+
220:Sussex spaniel
|
222 |
+
221:Irish water spaniel
|
223 |
+
222:kuvasz
|
224 |
+
223:schipperke
|
225 |
+
224:groenendael
|
226 |
+
225:malinois
|
227 |
+
226:briard
|
228 |
+
227:kelpie
|
229 |
+
228:komondor
|
230 |
+
229:Old English sheepdog, bobtail
|
231 |
+
230:Shetland sheepdog, Shetland sheep dog, Shetland
|
232 |
+
231:collie
|
233 |
+
232:Border collie
|
234 |
+
233:Bouvier des Flandres, Bouviers des Flandres
|
235 |
+
234:Rottweiler
|
236 |
+
235:German shepherd, German shepherd dog, German police dog, alsatian
|
237 |
+
236:Doberman, Doberman pinscher
|
238 |
+
237:miniature pinscher
|
239 |
+
238:Greater Swiss Mountain dog
|
240 |
+
239:Bernese mountain dog
|
241 |
+
240:Appenzeller
|
242 |
+
241:EntleBucher
|
243 |
+
242:boxer
|
244 |
+
243:bull mastiff
|
245 |
+
244:Tibetan mastiff
|
246 |
+
245:French bulldog
|
247 |
+
246:Great Dane
|
248 |
+
247:Saint Bernard, St Bernard
|
249 |
+
248:Eskimo dog, husky
|
250 |
+
249:malamute, malemute, Alaskan malamute
|
251 |
+
250:Siberian husky
|
252 |
+
251:dalmatian, coach dog, carriage dog
|
253 |
+
252:affenpinscher, monkey pinscher, monkey dog
|
254 |
+
253:basenji
|
255 |
+
254:pug, pug-dog
|
256 |
+
255:Leonberg
|
257 |
+
256:Newfoundland, Newfoundland dog
|
258 |
+
257:Great Pyrenees
|
259 |
+
258:Samoyed, Samoyede
|
260 |
+
259:Pomeranian
|
261 |
+
260:chow, chow chow
|
262 |
+
261:keeshond
|
263 |
+
262:Brabancon griffon
|
264 |
+
263:Pembroke, Pembroke Welsh corgi
|
265 |
+
264:Cardigan, Cardigan Welsh corgi
|
266 |
+
265:toy poodle
|
267 |
+
266:miniature poodle
|
268 |
+
267:standard poodle
|
269 |
+
268:Mexican hairless
|
270 |
+
269:timber wolf, grey wolf, gray wolf, Canis lupus
|
271 |
+
270:white wolf, Arctic wolf, Canis lupus tundrarum
|
272 |
+
271:red wolf, maned wolf, Canis rufus, Canis niger
|
273 |
+
272:coyote, prairie wolf, brush wolf, Canis latrans
|
274 |
+
273:dingo, warrigal, warragal, Canis dingo
|
275 |
+
274:dhole, Cuon alpinus
|
276 |
+
275:African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus
|
277 |
+
276:hyena, hyaena
|
278 |
+
277:red fox, Vulpes vulpes
|
279 |
+
278:kit fox, Vulpes macrotis
|
280 |
+
279:Arctic fox, white fox, Alopex lagopus
|
281 |
+
280:grey fox, gray fox, Urocyon cinereoargenteus
|
282 |
+
281:tabby, tabby cat
|
283 |
+
282:tiger cat
|
284 |
+
283:Persian cat
|
285 |
+
284:Siamese cat, Siamese
|
286 |
+
285:Egyptian cat
|
287 |
+
286:cougar, puma, catamount, mountain lion, painter, panther, Felis concolor
|
288 |
+
287:lynx, catamount
|
289 |
+
288:leopard, Panthera pardus
|
290 |
+
289:snow leopard, ounce, Panthera uncia
|
291 |
+
290:jaguar, panther, Panthera onca, Felis onca
|
292 |
+
291:lion, king of beasts, Panthera leo
|
293 |
+
292:tiger, Panthera tigris
|
294 |
+
293:cheetah, chetah, Acinonyx jubatus
|
295 |
+
294:brown bear, bruin, Ursus arctos
|
296 |
+
295:American black bear, black bear, Ursus americanus, Euarctos americanus
|
297 |
+
296:ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus
|
298 |
+
297:sloth bear, Melursus ursinus, Ursus ursinus
|
299 |
+
298:mongoose
|
300 |
+
299:meerkat, mierkat
|
301 |
+
300:tiger beetle
|
302 |
+
301:ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle
|
303 |
+
302:ground beetle, carabid beetle
|
304 |
+
303:long-horned beetle, longicorn, longicorn beetle
|
305 |
+
304:leaf beetle, chrysomelid
|
306 |
+
305:dung beetle
|
307 |
+
306:rhinoceros beetle
|
308 |
+
307:weevil
|
309 |
+
308:fly
|
310 |
+
309:bee
|
311 |
+
310:ant, emmet, pismire
|
312 |
+
311:grasshopper, hopper
|
313 |
+
312:cricket
|
314 |
+
313:walking stick, walkingstick, stick insect
|
315 |
+
314:cockroach, roach
|
316 |
+
315:mantis, mantid
|
317 |
+
316:cicada, cicala
|
318 |
+
317:leafhopper
|
319 |
+
318:lacewing, lacewing fly
|
320 |
+
319:dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk
|
321 |
+
320:damselfly
|
322 |
+
321:admiral
|
323 |
+
322:ringlet, ringlet butterfly
|
324 |
+
323:monarch, monarch butterfly, milkweed butterfly, Danaus plexippus
|
325 |
+
324:cabbage butterfly
|
326 |
+
325:sulphur butterfly, sulfur butterfly
|
327 |
+
326:lycaenid, lycaenid butterfly
|
328 |
+
327:starfish, sea star
|
329 |
+
328:sea urchin
|
330 |
+
329:sea cucumber, holothurian
|
331 |
+
330:wood rabbit, cottontail, cottontail rabbit
|
332 |
+
331:hare
|
333 |
+
332:Angora, Angora rabbit
|
334 |
+
333:hamster
|
335 |
+
334:porcupine, hedgehog
|
336 |
+
335:fox squirrel, eastern fox squirrel, Sciurus niger
|
337 |
+
336:marmot
|
338 |
+
337:beaver
|
339 |
+
338:guinea pig, Cavia cobaya
|
340 |
+
339:sorrel
|
341 |
+
340:zebra
|
342 |
+
341:hog, pig, grunter, squealer, Sus scrofa
|
343 |
+
342:wild boar, boar, Sus scrofa
|
344 |
+
343:warthog
|
345 |
+
344:hippopotamus, hippo, river horse, Hippopotamus amphibius
|
346 |
+
345:ox
|
347 |
+
346:water buffalo, water ox, Asiatic buffalo, Bubalus bubalis
|
348 |
+
347:bison
|
349 |
+
348:ram, tup
|
350 |
+
349:bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis
|
351 |
+
350:ibex, Capra ibex
|
352 |
+
351:hartebeest
|
353 |
+
352:impala, Aepyceros melampus
|
354 |
+
353:gazelle
|
355 |
+
354:Arabian camel, dromedary, Camelus dromedarius
|
356 |
+
355:llama
|
357 |
+
356:weasel
|
358 |
+
357:mink
|
359 |
+
358:polecat, fitch, foulmart, foumart, Mustela putorius
|
360 |
+
359:black-footed ferret, ferret, Mustela nigripes
|
361 |
+
360:otter
|
362 |
+
361:skunk, polecat, wood pussy
|
363 |
+
362:badger
|
364 |
+
363:armadillo
|
365 |
+
364:three-toed sloth, ai, Bradypus tridactylus
|
366 |
+
365:orangutan, orang, orangutang, Pongo pygmaeus
|
367 |
+
366:gorilla, Gorilla gorilla
|
368 |
+
367:chimpanzee, chimp, Pan troglodytes
|
369 |
+
368:gibbon, Hylobates lar
|
370 |
+
369:siamang, Hylobates syndactylus, Symphalangus syndactylus
|
371 |
+
370:guenon, guenon monkey
|
372 |
+
371:patas, hussar monkey, Erythrocebus patas
|
373 |
+
372:baboon
|
374 |
+
373:macaque
|
375 |
+
374:langur
|
376 |
+
375:colobus, colobus monkey
|
377 |
+
376:proboscis monkey, Nasalis larvatus
|
378 |
+
377:marmoset
|
379 |
+
378:capuchin, ringtail, Cebus capucinus
|
380 |
+
379:howler monkey, howler
|
381 |
+
380:titi, titi monkey
|
382 |
+
381:spider monkey, Ateles geoffroyi
|
383 |
+
382:squirrel monkey, Saimiri sciureus
|
384 |
+
383:Madagascar cat, ring-tailed lemur, Lemur catta
|
385 |
+
384:indri, indris, Indri indri, Indri brevicaudatus
|
386 |
+
385:Indian elephant, Elephas maximus
|
387 |
+
386:African elephant, Loxodonta africana
|
388 |
+
387:lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens
|
389 |
+
388:giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca
|
390 |
+
389:barracouta, snoek
|
391 |
+
390:eel
|
392 |
+
391:coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch
|
393 |
+
392:rock beauty, Holocanthus tricolor
|
394 |
+
393:anemone fish
|
395 |
+
394:sturgeon
|
396 |
+
395:gar, garfish, garpike, billfish, Lepisosteus osseus
|
397 |
+
396:lionfish
|
398 |
+
397:puffer, pufferfish, blowfish, globefish
|
399 |
+
398:abacus
|
400 |
+
399:abaya
|
401 |
+
400:academic gown, academic robe, judge's robe
|
402 |
+
401:accordion, piano accordion, squeeze box
|
403 |
+
402:acoustic guitar
|
404 |
+
403:aircraft carrier, carrier, flattop, attack aircraft carrier
|
405 |
+
404:airliner
|
406 |
+
405:airship, dirigible
|
407 |
+
406:altar
|
408 |
+
407:ambulance
|
409 |
+
408:amphibian, amphibious vehicle
|
410 |
+
409:analog clock
|
411 |
+
410:apiary, bee house
|
412 |
+
411:apron
|
413 |
+
412:ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin
|
414 |
+
413:assault rifle, assault gun
|
415 |
+
414:backpack, back pack, knapsack, packsack, rucksack, haversack
|
416 |
+
415:bakery, bakeshop, bakehouse
|
417 |
+
416:balance beam, beam
|
418 |
+
417:balloon
|
419 |
+
418:ballpoint, ballpoint pen, ballpen, Biro
|
420 |
+
419:Band Aid
|
421 |
+
420:banjo
|
422 |
+
421:bannister, banister, balustrade, balusters, handrail
|
423 |
+
422:barbell
|
424 |
+
423:barber chair
|
425 |
+
424:barbershop
|
426 |
+
425:barn
|
427 |
+
426:barometer
|
428 |
+
427:barrel, cask
|
429 |
+
428:barrow, garden cart, lawn cart, wheelbarrow
|
430 |
+
429:baseball
|
431 |
+
430:basketball
|
432 |
+
431:bassinet
|
433 |
+
432:bassoon
|
434 |
+
433:bathing cap, swimming cap
|
435 |
+
434:bath towel
|
436 |
+
435:bathtub, bathing tub, bath, tub
|
437 |
+
436:beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon
|
438 |
+
437:beacon, lighthouse, beacon light, pharos
|
439 |
+
438:beaker
|
440 |
+
439:bearskin, busby, shako
|
441 |
+
440:beer bottle
|
442 |
+
441:beer glass
|
443 |
+
442:bell cote, bell cot
|
444 |
+
443:bib
|
445 |
+
444:bicycle-built-for-two, tandem bicycle, tandem
|
446 |
+
445:bikini, two-piece
|
447 |
+
446:binder, ring-binder
|
448 |
+
447:binoculars, field glasses, opera glasses
|
449 |
+
448:birdhouse
|
450 |
+
449:boathouse
|
451 |
+
450:bobsled, bobsleigh, bob
|
452 |
+
451:bolo tie, bolo, bola tie, bola
|
453 |
+
452:bonnet, poke bonnet
|
454 |
+
453:bookcase
|
455 |
+
454:bookshop, bookstore, bookstall
|
456 |
+
455:bottlecap
|
457 |
+
456:bow
|
458 |
+
457:bow tie, bow-tie, bowtie
|
459 |
+
458:brass, memorial tablet, plaque
|
460 |
+
459:brassiere, bra, bandeau
|
461 |
+
460:breakwater, groin, groyne, mole, bulwark, seawall, jetty
|
462 |
+
461:breastplate, aegis, egis
|
463 |
+
462:broom
|
464 |
+
463:bucket, pail
|
465 |
+
464:buckle
|
466 |
+
465:bulletproof vest
|
467 |
+
466:bullet train, bullet
|
468 |
+
467:butcher shop, meat market
|
469 |
+
468:cab, hack, taxi, taxicab
|
470 |
+
469:caldron, cauldron
|
471 |
+
470:candle, taper, wax light
|
472 |
+
471:cannon
|
473 |
+
472:canoe
|
474 |
+
473:can opener, tin opener
|
475 |
+
474:cardigan
|
476 |
+
475:car mirror
|
477 |
+
476:carousel, carrousel, merry-go-round, roundabout, whirligig
|
478 |
+
477:carpenter's kit, tool kit
|
479 |
+
478:carton
|
480 |
+
479:car wheel
|
481 |
+
480:cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM
|
482 |
+
481:cassette
|
483 |
+
482:cassette player
|
484 |
+
483:castle
|
485 |
+
484:catamaran
|
486 |
+
485:CD player
|
487 |
+
486:cello, violoncello
|
488 |
+
487:cellular telephone, cellular phone, cellphone, cell, mobile phone
|
489 |
+
488:chain
|
490 |
+
489:chainlink fence
|
491 |
+
490:chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour
|
492 |
+
491:chain saw, chainsaw
|
493 |
+
492:chest
|
494 |
+
493:chiffonier, commode
|
495 |
+
494:chime, bell, gong
|
496 |
+
495:china cabinet, china closet
|
497 |
+
496:Christmas stocking
|
498 |
+
497:church, church building
|
499 |
+
498:cinema, movie theater, movie theatre, movie house, picture palace
|
500 |
+
499:cleaver, meat cleaver, chopper
|
501 |
+
500:cliff dwelling
|
502 |
+
501:cloak
|
503 |
+
502:clog, geta, patten, sabot
|
504 |
+
503:cocktail shaker
|
505 |
+
504:coffee mug
|
506 |
+
505:coffeepot
|
507 |
+
506:coil, spiral, volute, whorl, helix
|
508 |
+
507:combination lock
|
509 |
+
508:computer keyboard, keypad
|
510 |
+
509:confectionery, confectionary, candy store
|
511 |
+
510:container ship, containership, container vessel
|
512 |
+
511:convertible
|
513 |
+
512:corkscrew, bottle screw
|
514 |
+
513:cornet, horn, trumpet, trump
|
515 |
+
514:cowboy boot
|
516 |
+
515:cowboy hat, ten-gallon hat
|
517 |
+
516:cradle
|
518 |
+
517:crane
|
519 |
+
518:crash helmet
|
520 |
+
519:crate
|
521 |
+
520:crib, cot
|
522 |
+
521:Crock Pot
|
523 |
+
522:croquet ball
|
524 |
+
523:crutch
|
525 |
+
524:cuirass
|
526 |
+
525:dam, dike, dyke
|
527 |
+
526:desk
|
528 |
+
527:desktop computer
|
529 |
+
528:dial telephone, dial phone
|
530 |
+
529:diaper, nappy, napkin
|
531 |
+
530:digital clock
|
532 |
+
531:digital watch
|
533 |
+
532:dining table, board
|
534 |
+
533:dishrag, dishcloth
|
535 |
+
534:dishwasher, dish washer, dishwashing machine
|
536 |
+
535:disk brake, disc brake
|
537 |
+
536:dock, dockage, docking facility
|
538 |
+
537:dogsled, dog sled, dog sleigh
|
539 |
+
538:dome
|
540 |
+
539:doormat, welcome mat
|
541 |
+
540:drilling platform, offshore rig
|
542 |
+
541:drum, membranophone, tympan
|
543 |
+
542:drumstick
|
544 |
+
543:dumbbell
|
545 |
+
544:Dutch oven
|
546 |
+
545:electric fan, blower
|
547 |
+
546:electric guitar
|
548 |
+
547:electric locomotive
|
549 |
+
548:entertainment center
|
550 |
+
549:envelope
|
551 |
+
550:espresso maker
|
552 |
+
551:face powder
|
553 |
+
552:feather boa, boa
|
554 |
+
553:file, file cabinet, filing cabinet
|
555 |
+
554:fireboat
|
556 |
+
555:fire engine, fire truck
|
557 |
+
556:fire screen, fireguard
|
558 |
+
557:flagpole, flagstaff
|
559 |
+
558:flute, transverse flute
|
560 |
+
559:folding chair
|
561 |
+
560:football helmet
|
562 |
+
561:forklift
|
563 |
+
562:fountain
|
564 |
+
563:fountain pen
|
565 |
+
564:four-poster
|
566 |
+
565:freight car
|
567 |
+
566:French horn, horn
|
568 |
+
567:frying pan, frypan, skillet
|
569 |
+
568:fur coat
|
570 |
+
569:garbage truck, dustcart
|
571 |
+
570:gasmask, respirator, gas helmet
|
572 |
+
571:gas pump, gasoline pump, petrol pump, island dispenser
|
573 |
+
572:goblet
|
574 |
+
573:go-kart
|
575 |
+
574:golf ball
|
576 |
+
575:golfcart, golf cart
|
577 |
+
576:gondola
|
578 |
+
577:gong, tam-tam
|
579 |
+
578:gown
|
580 |
+
579:grand piano, grand
|
581 |
+
580:greenhouse, nursery, glasshouse
|
582 |
+
581:grille, radiator grille
|
583 |
+
582:grocery store, grocery, food market, market
|
584 |
+
583:guillotine
|
585 |
+
584:hair slide
|
586 |
+
585:hair spray
|
587 |
+
586:half track
|
588 |
+
587:hammer
|
589 |
+
588:hamper
|
590 |
+
589:hand blower, blow dryer, blow drier, hair dryer, hair drier
|
591 |
+
590:hand-held computer, hand-held microcomputer
|
592 |
+
591:handkerchief, hankie, hanky, hankey
|
593 |
+
592:hard disc, hard disk, fixed disk
|
594 |
+
593:harmonica, mouth organ, harp, mouth harp
|
595 |
+
594:harp
|
596 |
+
595:harvester, reaper
|
597 |
+
596:hatchet
|
598 |
+
597:holster
|
599 |
+
598:home theater, home theatre
|
600 |
+
599:honeycomb
|
601 |
+
600:hook, claw
|
602 |
+
601:hoopskirt, crinoline
|
603 |
+
602:horizontal bar, high bar
|
604 |
+
603:horse cart, horse-cart
|
605 |
+
604:hourglass
|
606 |
+
605:iPod
|
607 |
+
606:iron, smoothing iron
|
608 |
+
607:jack-o'-lantern
|
609 |
+
608:jean, blue jean, denim
|
610 |
+
609:jeep, landrover
|
611 |
+
610:jersey, T-shirt, tee shirt
|
612 |
+
611:jigsaw puzzle
|
613 |
+
612:jinrikisha, ricksha, rickshaw
|
614 |
+
613:joystick
|
615 |
+
614:kimono
|
616 |
+
615:knee pad
|
617 |
+
616:knot
|
618 |
+
617:lab coat, laboratory coat
|
619 |
+
618:ladle
|
620 |
+
619:lampshade, lamp shade
|
621 |
+
620:laptop, laptop computer
|
622 |
+
621:lawn mower, mower
|
623 |
+
622:lens cap, lens cover
|
624 |
+
623:letter opener, paper knife, paperknife
|
625 |
+
624:library
|
626 |
+
625:lifeboat
|
627 |
+
626:lighter, light, igniter, ignitor
|
628 |
+
627:limousine, limo
|
629 |
+
628:liner, ocean liner
|
630 |
+
629:lipstick, lip rouge
|
631 |
+
630:Loafer
|
632 |
+
631:lotion
|
633 |
+
632:loudspeaker, speaker, speaker unit, loudspeaker system, speaker system
|
634 |
+
633:loupe, jeweler's loupe
|
635 |
+
634:lumbermill, sawmill
|
636 |
+
635:magnetic compass
|
637 |
+
636:mailbag, postbag
|
638 |
+
637:mailbox, letter box
|
639 |
+
638:maillot
|
640 |
+
639:maillot, tank suit
|
641 |
+
640:manhole cover
|
642 |
+
641:maraca
|
643 |
+
642:marimba, xylophone
|
644 |
+
643:mask
|
645 |
+
644:matchstick
|
646 |
+
645:maypole
|
647 |
+
646:maze, labyrinth
|
648 |
+
647:measuring cup
|
649 |
+
648:medicine chest, medicine cabinet
|
650 |
+
649:megalith, megalithic structure
|
651 |
+
650:microphone, mike
|
652 |
+
651:microwave, microwave oven
|
653 |
+
652:military uniform
|
654 |
+
653:milk can
|
655 |
+
654:minibus
|
656 |
+
655:miniskirt, mini
|
657 |
+
656:minivan
|
658 |
+
657:missile
|
659 |
+
658:mitten
|
660 |
+
659:mixing bowl
|
661 |
+
660:mobile home, manufactured home
|
662 |
+
661:Model T
|
663 |
+
662:modem
|
664 |
+
663:monastery
|
665 |
+
664:monitor
|
666 |
+
665:moped
|
667 |
+
666:mortar
|
668 |
+
667:mortarboard
|
669 |
+
668:mosque
|
670 |
+
669:mosquito net
|
671 |
+
670:motor scooter, scooter
|
672 |
+
671:mountain bike, all-terrain bike, off-roader
|
673 |
+
672:mountain tent
|
674 |
+
673:mouse, computer mouse
|
675 |
+
674:mousetrap
|
676 |
+
675:moving van
|
677 |
+
676:muzzle
|
678 |
+
677:nail
|
679 |
+
678:neck brace
|
680 |
+
679:necklace
|
681 |
+
680:nipple
|
682 |
+
681:notebook, notebook computer
|
683 |
+
682:obelisk
|
684 |
+
683:oboe, hautboy, hautbois
|
685 |
+
684:ocarina, sweet potato
|
686 |
+
685:odometer, hodometer, mileometer, milometer
|
687 |
+
686:oil filter
|
688 |
+
687:organ, pipe organ
|
689 |
+
688:oscilloscope, scope, cathode-ray oscilloscope, CRO
|
690 |
+
689:overskirt
|
691 |
+
690:oxcart
|
692 |
+
691:oxygen mask
|
693 |
+
692:packet
|
694 |
+
693:paddle, boat paddle
|
695 |
+
694:paddlewheel, paddle wheel
|
696 |
+
695:padlock
|
697 |
+
696:paintbrush
|
698 |
+
697:pajama, pyjama, pj's, jammies
|
699 |
+
698:palace
|
700 |
+
699:panpipe, pandean pipe, syrinx
|
701 |
+
700:paper towel
|
702 |
+
701:parachute, chute
|
703 |
+
702:parallel bars, bars
|
704 |
+
703:park bench
|
705 |
+
704:parking meter
|
706 |
+
705:passenger car, coach, carriage
|
707 |
+
706:patio, terrace
|
708 |
+
707:pay-phone, pay-station
|
709 |
+
708:pedestal, plinth, footstall
|
710 |
+
709:pencil box, pencil case
|
711 |
+
710:pencil sharpener
|
712 |
+
711:perfume, essence
|
713 |
+
712:Petri dish
|
714 |
+
713:photocopier
|
715 |
+
714:pick, plectrum, plectron
|
716 |
+
715:pickelhaube
|
717 |
+
716:picket fence, paling
|
718 |
+
717:pickup, pickup truck
|
719 |
+
718:pier
|
720 |
+
719:piggy bank, penny bank
|
721 |
+
720:pill bottle
|
722 |
+
721:pillow
|
723 |
+
722:ping-pong ball
|
724 |
+
723:pinwheel
|
725 |
+
724:pirate, pirate ship
|
726 |
+
725:pitcher, ewer
|
727 |
+
726:plane, carpenter's plane, woodworking plane
|
728 |
+
727:planetarium
|
729 |
+
728:plastic bag
|
730 |
+
729:plate rack
|
731 |
+
730:plow, plough
|
732 |
+
731:plunger, plumber's helper
|
733 |
+
732:Polaroid camera, Polaroid Land camera
|
734 |
+
733:pole
|
735 |
+
734:police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria
|
736 |
+
735:poncho
|
737 |
+
736:pool table, billiard table, snooker table
|
738 |
+
737:pop bottle, soda bottle
|
739 |
+
738:pot, flowerpot
|
740 |
+
739:potter's wheel
|
741 |
+
740:power drill
|
742 |
+
741:prayer rug, prayer mat
|
743 |
+
742:printer
|
744 |
+
743:prison, prison house
|
745 |
+
744:projectile, missile
|
746 |
+
745:projector
|
747 |
+
746:puck, hockey puck
|
748 |
+
747:punching bag, punch bag, punching ball, punchball
|
749 |
+
748:purse
|
750 |
+
749:quill, quill pen
|
751 |
+
750:quilt, comforter, comfort, puff
|
752 |
+
751:racer, race car, racing car
|
753 |
+
752:racket, racquet
|
754 |
+
753:radiator
|
755 |
+
754:radio, wireless
|
756 |
+
755:radio telescope, radio reflector
|
757 |
+
756:rain barrel
|
758 |
+
757:recreational vehicle, RV, R.V.
|
759 |
+
758:reel
|
760 |
+
759:reflex camera
|
761 |
+
760:refrigerator, icebox
|
762 |
+
761:remote control, remote
|
763 |
+
762:restaurant, eating house, eating place, eatery
|
764 |
+
763:revolver, six-gun, six-shooter
|
765 |
+
764:rifle
|
766 |
+
765:rocking chair, rocker
|
767 |
+
766:rotisserie
|
768 |
+
767:rubber eraser, rubber, pencil eraser
|
769 |
+
768:rugby ball
|
770 |
+
769:rule, ruler
|
771 |
+
770:running shoe
|
772 |
+
771:safe
|
773 |
+
772:safety pin
|
774 |
+
773:saltshaker, salt shaker
|
775 |
+
774:sandal
|
776 |
+
775:sarong
|
777 |
+
776:sax, saxophone
|
778 |
+
777:scabbard
|
779 |
+
778:scale, weighing machine
|
780 |
+
779:school bus
|
781 |
+
780:schooner
|
782 |
+
781:scoreboard
|
783 |
+
782:screen, CRT screen
|
784 |
+
783:screw
|
785 |
+
784:screwdriver
|
786 |
+
785:seat belt, seatbelt
|
787 |
+
786:sewing machine
|
788 |
+
787:shield, buckler
|
789 |
+
788:shoe shop, shoe-shop, shoe store
|
790 |
+
789:shoji
|
791 |
+
790:shopping basket
|
792 |
+
791:shopping cart
|
793 |
+
792:shovel
|
794 |
+
793:shower cap
|
795 |
+
794:shower curtain
|
796 |
+
795:ski
|
797 |
+
796:ski mask
|
798 |
+
797:sleeping bag
|
799 |
+
798:slide rule, slipstick
|
800 |
+
799:sliding door
|
801 |
+
800:slot, one-armed bandit
|
802 |
+
801:snorkel
|
803 |
+
802:snowmobile
|
804 |
+
803:snowplow, snowplough
|
805 |
+
804:soap dispenser
|
806 |
+
805:soccer ball
|
807 |
+
806:sock
|
808 |
+
807:solar dish, solar collector, solar furnace
|
809 |
+
808:sombrero
|
810 |
+
809:soup bowl
|
811 |
+
810:space bar
|
812 |
+
811:space heater
|
813 |
+
812:space shuttle
|
814 |
+
813:spatula
|
815 |
+
814:speedboat
|
816 |
+
815:spider web, spider's web
|
817 |
+
816:spindle
|
818 |
+
817:sports car, sport car
|
819 |
+
818:spotlight, spot
|
820 |
+
819:stage
|
821 |
+
820:steam locomotive
|
822 |
+
821:steel arch bridge
|
823 |
+
822:steel drum
|
824 |
+
823:stethoscope
|
825 |
+
824:stole
|
826 |
+
825:stone wall
|
827 |
+
826:stopwatch, stop watch
|
828 |
+
827:stove
|
829 |
+
828:strainer
|
830 |
+
829:streetcar, tram, tramcar, trolley, trolley car
|
831 |
+
830:stretcher
|
832 |
+
831:studio couch, day bed
|
833 |
+
832:stupa, tope
|
834 |
+
833:submarine, pigboat, sub, U-boat
|
835 |
+
834:suit, suit of clothes
|
836 |
+
835:sundial
|
837 |
+
836:sunglass
|
838 |
+
837:sunglasses, dark glasses, shades
|
839 |
+
838:sunscreen, sunblock, sun blocker
|
840 |
+
839:suspension bridge
|
841 |
+
840:swab, swob, mop
|
842 |
+
841:sweatshirt
|
843 |
+
842:swimming trunks, bathing trunks
|
844 |
+
843:swing
|
845 |
+
844:switch, electric switch, electrical switch
|
846 |
+
845:syringe
|
847 |
+
846:table lamp
|
848 |
+
847:tank, army tank, armored combat vehicle, armoured combat vehicle
|
849 |
+
848:tape player
|
850 |
+
849:teapot
|
851 |
+
850:teddy, teddy bear
|
852 |
+
851:television, television system
|
853 |
+
852:tennis ball
|
854 |
+
853:thatch, thatched roof
|
855 |
+
854:theater curtain, theatre curtain
|
856 |
+
855:thimble
|
857 |
+
856:thresher, thrasher, threshing machine
|
858 |
+
857:throne
|
859 |
+
858:tile roof
|
860 |
+
859:toaster
|
861 |
+
860:tobacco shop, tobacconist shop, tobacconist
|
862 |
+
861:toilet seat
|
863 |
+
862:torch
|
864 |
+
863:totem pole
|
865 |
+
864:tow truck, tow car, wrecker
|
866 |
+
865:toyshop
|
867 |
+
866:tractor
|
868 |
+
867:trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi
|
869 |
+
868:tray
|
870 |
+
869:trench coat
|
871 |
+
870:tricycle, trike, velocipede
|
872 |
+
871:trimaran
|
873 |
+
872:tripod
|
874 |
+
873:triumphal arch
|
875 |
+
874:trolleybus, trolley coach, trackless trolley
|
876 |
+
875:trombone
|
877 |
+
876:tub, vat
|
878 |
+
877:turnstile
|
879 |
+
878:typewriter keyboard
|
880 |
+
879:umbrella
|
881 |
+
880:unicycle, monocycle
|
882 |
+
881:upright, upright piano
|
883 |
+
882:vacuum, vacuum cleaner
|
884 |
+
883:vase
|
885 |
+
884:vault
|
886 |
+
885:velvet
|
887 |
+
886:vending machine
|
888 |
+
887:vestment
|
889 |
+
888:viaduct
|
890 |
+
889:violin, fiddle
|
891 |
+
890:volleyball
|
892 |
+
891:waffle iron
|
893 |
+
892:wall clock
|
894 |
+
893:wallet, billfold, notecase, pocketbook
|
895 |
+
894:wardrobe, closet, press
|
896 |
+
895:warplane, military plane
|
897 |
+
896:washbasin, handbasin, washbowl, lavabo, wash-hand basin
|
898 |
+
897:washer, automatic washer, washing machine
|
899 |
+
898:water bottle
|
900 |
+
899:water jug
|
901 |
+
900:water tower
|
902 |
+
901:whiskey jug
|
903 |
+
902:whistle
|
904 |
+
903:wig
|
905 |
+
904:window screen
|
906 |
+
905:window shade
|
907 |
+
906:Windsor tie
|
908 |
+
907:wine bottle
|
909 |
+
908:wing
|
910 |
+
909:wok
|
911 |
+
910:wooden spoon
|
912 |
+
911:wool, woolen, woollen
|
913 |
+
912:worm fence, snake fence, snake-rail fence, Virginia fence
|
914 |
+
913:wreck
|
915 |
+
914:yawl
|
916 |
+
915:yurt
|
917 |
+
916:web site, website, internet site, site
|
918 |
+
917:comic book
|
919 |
+
918:crossword puzzle, crossword
|
920 |
+
919:street sign
|
921 |
+
920:traffic light, traffic signal, stoplight
|
922 |
+
921:book jacket, dust cover, dust jacket, dust wrapper
|
923 |
+
922:menu
|
924 |
+
923:plate
|
925 |
+
924:guacamole
|
926 |
+
925:consomme
|
927 |
+
926:hot pot, hotpot
|
928 |
+
927:trifle
|
929 |
+
928:ice cream, icecream
|
930 |
+
929:ice lolly, lolly, lollipop, popsicle
|
931 |
+
930:French loaf
|
932 |
+
931:bagel, beigel
|
933 |
+
932:pretzel
|
934 |
+
933:cheeseburger
|
935 |
+
934:hotdog, hot dog, red hot
|
936 |
+
935:mashed potato
|
937 |
+
936:head cabbage
|
938 |
+
937:broccoli
|
939 |
+
938:cauliflower
|
940 |
+
939:zucchini, courgette
|
941 |
+
940:spaghetti squash
|
942 |
+
941:acorn squash
|
943 |
+
942:butternut squash
|
944 |
+
943:cucumber, cuke
|
945 |
+
944:artichoke, globe artichoke
|
946 |
+
945:bell pepper
|
947 |
+
946:cardoon
|
948 |
+
947:mushroom
|
949 |
+
948:Granny Smith
|
950 |
+
949:strawberry
|
951 |
+
950:orange
|
952 |
+
951:lemon
|
953 |
+
952:fig
|
954 |
+
953:pineapple, ananas
|
955 |
+
954:banana
|
956 |
+
955:jackfruit, jak, jack
|
957 |
+
956:custard apple
|
958 |
+
957:pomegranate
|
959 |
+
958:hay
|
960 |
+
959:carbonara
|
961 |
+
960:chocolate sauce, chocolate syrup
|
962 |
+
961:dough
|
963 |
+
962:meat loaf, meatloaf
|
964 |
+
963:pizza, pizza pie
|
965 |
+
964:potpie
|
966 |
+
965:burrito
|
967 |
+
966:red wine
|
968 |
+
967:espresso
|
969 |
+
968:cup
|
970 |
+
969:eggnog
|
971 |
+
970:alp
|
972 |
+
971:bubble
|
973 |
+
972:cliff, drop, drop-off
|
974 |
+
973:coral reef
|
975 |
+
974:geyser
|
976 |
+
975:lakeside, lakeshore
|
977 |
+
976:promontory, headland, head, foreland
|
978 |
+
977:sandbar, sand bar
|
979 |
+
978:seashore, coast, seacoast, sea-coast
|
980 |
+
979:valley, vale
|
981 |
+
980:volcano
|
982 |
+
981:ballplayer, baseball player
|
983 |
+
982:groom, bridegroom
|
984 |
+
983:scuba diver
|
985 |
+
984:rapeseed
|
986 |
+
985:daisy
|
987 |
+
986:yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum
|
988 |
+
987:corn
|
989 |
+
988:acorn
|
990 |
+
989:hip, rose hip, rosehip
|
991 |
+
990:buckeye, horse chestnut, conker
|
992 |
+
991:coral fungus
|
993 |
+
992:agaric
|
994 |
+
993:gyromitra
|
995 |
+
994:stinkhorn, carrion fungus
|
996 |
+
995:earthstar
|
997 |
+
996:hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa
|
998 |
+
997:bolete
|
999 |
+
998:ear, spike, capitulum
|
1000 |
+
999:toilet tissue, toilet paper, bathroom tissue
|
autosparsity/examples/resnet50.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4428727ffe996c87fcb871d7e21093c34c64b76f978f9de3c813322d61419470
|
3 |
+
size 102146376
|
autosparsity/examples/test.py
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import cv2
|
3 |
+
from rknn.api import RKNN
|
4 |
+
|
5 |
+
|
6 |
+
ONNX_MODEL = 'resnet50.onnx'
|
7 |
+
RKNN_MODEL = 'resnet50.rknn'
|
8 |
+
|
9 |
+
def show_outputs(outputs):
|
10 |
+
output = outputs[0][0]
|
11 |
+
index = sorted(range(len(output)), key=lambda k : output[k], reverse=True)
|
12 |
+
fp = open('./labels.txt', 'r')
|
13 |
+
labels = fp.readlines()
|
14 |
+
top5_str = 'resnet50_sparse_infer\n-----TOP 5-----\n'
|
15 |
+
for i in range(5):
|
16 |
+
value = output[index[i]]
|
17 |
+
if value > 0:
|
18 |
+
topi = '[{:>3d}] score:{:.6f} class:"{}"\n'.format(index[i], value, labels[index[i]].strip().split(':')[-1])
|
19 |
+
else:
|
20 |
+
topi = '[ -1]: 0.0\n'
|
21 |
+
top5_str += topi
|
22 |
+
print(top5_str.strip())
|
23 |
+
|
24 |
+
|
25 |
+
if __name__ == '__main__':
|
26 |
+
|
27 |
+
# Create RKNN object
|
28 |
+
rknn = RKNN(verbose=True)
|
29 |
+
|
30 |
+
# Pre-process config
|
31 |
+
print('--> Config model')
|
32 |
+
rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.395, 57.12, 57.375], target_platform='rk3576', sparse_infer=True)
|
33 |
+
print('done')
|
34 |
+
|
35 |
+
# Load model
|
36 |
+
print('--> Loading model')
|
37 |
+
ret = rknn.load_onnx(model=ONNX_MODEL)
|
38 |
+
if ret != 0:
|
39 |
+
print('Load model failed!')
|
40 |
+
exit(ret)
|
41 |
+
print('done')
|
42 |
+
|
43 |
+
# Build model
|
44 |
+
print('--> Building model')
|
45 |
+
ret = rknn.build(do_quantization=True, dataset='./datasets.txt')
|
46 |
+
if ret != 0:
|
47 |
+
print('Build model failed!')
|
48 |
+
exit(ret)
|
49 |
+
print('done')
|
50 |
+
|
51 |
+
# Export rknn model
|
52 |
+
print('--> Export rknn model')
|
53 |
+
ret = rknn.export_rknn(RKNN_MODEL)
|
54 |
+
if ret != 0:
|
55 |
+
print('Export rknn model failed!')
|
56 |
+
exit(ret)
|
57 |
+
print('done')
|
58 |
+
|
59 |
+
# Set inputs
|
60 |
+
img = cv2.imread('./dog_224x224.jpg')
|
61 |
+
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
62 |
+
img = np.expand_dims(img, 0)
|
63 |
+
|
64 |
+
# Init runtime environment
|
65 |
+
print('--> Init runtime environment')
|
66 |
+
ret = rknn.init_runtime(target='rk3576')
|
67 |
+
if ret != 0:
|
68 |
+
print('Init runtime environment failed!')
|
69 |
+
exit(ret)
|
70 |
+
print('done')
|
71 |
+
|
72 |
+
# Inference
|
73 |
+
print('--> Running model')
|
74 |
+
outputs = rknn.inference(inputs=[img], data_format=['nhwc'])
|
75 |
+
x = outputs[0]
|
76 |
+
output = np.exp(x)/np.sum(np.exp(x))
|
77 |
+
outputs = [output]
|
78 |
+
show_outputs(outputs)
|
79 |
+
print('done')
|
80 |
+
|
81 |
+
rknn.release()
|
autosparsity/packages/autosparsity-1.0-cp310-cp310-linux_x86_64.whl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:91738c554c28a71a17c799d9e8c7e600212c34a8a6cd36a178f13ef005f0b925
|
3 |
+
size 1726486
|
autosparsity/packages/autosparsity-1.0-cp311-cp311-linux_x86_64.whl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fb6388e740816010b536fbd1e93f99dd38e78a3591df9b25c59e0293f6ecc85b
|
3 |
+
size 1723914
|
autosparsity/packages/autosparsity-1.0-cp36-cp36m-linux_x86_64.whl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b5741fbe4ffa24d68508ff066b6743e1af58c032b1189e81b1ad805d2007de2d
|
3 |
+
size 5122147
|
autosparsity/packages/autosparsity-1.0-cp37-cp37m-linux_x86_64.whl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bf04d2f3534947215b0af1a2cdc083f0ec989a88f86c6c03532fb86d14acdd93
|
3 |
+
size 5308248
|
autosparsity/packages/autosparsity-1.0-cp38-cp38-linux_x86_64.whl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5f9f3329905adeb050e14e01fcd262aa1dc21b65efeba38c74203006330dcc30
|
3 |
+
size 6906641
|
autosparsity/packages/autosparsity-1.0-cp39-cp39-linux_x86_64.whl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a89321f12ab53480a6bc0db1f30a3e61d229277e3e0e1e313a57ba509631f2d3
|
3 |
+
size 1727843
|
doc/01_Rockchip_RK2118_Quick_Start_RKNN_SDK_V2.1.0_CN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5faf0a127f6fc5272674420d83de1a401b1e458b1e61a66f93b90f33ea182877
|
3 |
+
size 15783332
|
doc/01_Rockchip_RK2118_Quick_Start_RKNN_SDK_V2.1.0_EN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7a2cca5f2847658a85e2dc0b39fdf1d9bd19afbef1a7303e67d01555eb96ca06
|
3 |
+
size 22421246
|
doc/01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.1.0_CN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bd91ab63287eae5e7de735d44ed42e2178d12d495d614098d4c033bb1416dbaa
|
3 |
+
size 58526084
|
doc/01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.1.0_EN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:513f8bb08f60c192e313c89fa8e2064812b15cebb5e7137a0e8deaf297f65e09
|
3 |
+
size 39216171
|
doc/01_Rockchip_RV1106_RV1103_Quick_Start_RKNN_SDK_V2.1.0_CN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c32cb3ef8d250bfdac1f86ec6bdeca8e3e0666aea40c36d0330bc6739ba8a400
|
3 |
+
size 30662929
|
doc/01_Rockchip_RV1106_RV1103_Quick_Start_RKNN_SDK_V2.1.0_EN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1c6055c7b5fc437127b27947dafa059068a48348db0a250d7fa5bfe62f33df99
|
3 |
+
size 23683494
|
doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.1.0_CN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:12426814125e12d82be5113e8dc9351184a452b9f6cc79d52517a0364d941e6d
|
3 |
+
size 10793826
|
doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.1.0_EN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:65118a948dc4ccb29bbacf80b41ced2c6fb2cc09e02a092761a97de714708ac3
|
3 |
+
size 8311627
|
doc/03_Rockchip_RKNPU_API_Reference_RKNN_Toolkit2_V2.1.0_CN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:44b6ea3f613abb822117d993604cbc56c21bbe354df4a0564b618bacd278b160
|
3 |
+
size 716783
|
doc/03_Rockchip_RKNPU_API_Reference_RKNN_Toolkit2_V2.1.0_EN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d879cb7e34e267ed9cb1256b59fa87bb33955f1e286a6efc25a0f2702d002288
|
3 |
+
size 213701
|
doc/04_Rockchip_RKNPU_API_Reference_RKNNRT_V2.1.0_CN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e7cc3573b8e25c54e6899caf18b787791e329c773e7c4d7b5f9513398612a10
|
3 |
+
size 986337
|
doc/04_Rockchip_RKNPU_API_Reference_RKNNRT_V2.1.0_EN.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f402e099a2728da4aee40c8f088d8dd2be127bd670ba76cbf787701d7b834e1e
|
3 |
+
size 336513
|
doc/05_RKNN_Compiler_Support_Operator_List_V2.1.0.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa08dd033288dd1a206ee8fe4e9d109b7dd8b9a8b615d5aa58bc72e4eeb0cca3
|
3 |
+
size 3702083
|
doc/RKNNToolKit2_OP_Support-v2.1.0.md
ADDED
@@ -0,0 +1,519 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# RKNNToolkit2 OPs Support
|
2 |
+
|
3 |
+
## ONNX OPs supported by RKNN Toolkit2
|
4 |
+
|
5 |
+
According to [ONNX official instructions](https://github.com/microsoft/onnxruntime/blob/master/docs/Versioning.md 'ONNX Version Description'), the corresponding ONNX opset version is 19.
|
6 |
+
The list of ONNX OPs supported by RKNN Toolkit2 is as follows:
|
7 |
+
<br>(For more restrictions, please refer to <RKNN_Compiler_Support_Operator_List>)
|
8 |
+
|
9 |
+
| **Operators** | **Remarks** |
|
10 |
+
| ------------------------- | --------------------------------------- |
|
11 |
+
| Abs | Not Supported |
|
12 |
+
| Acos | Not Supported |
|
13 |
+
| Acosh | Not Supported |
|
14 |
+
| Add | |
|
15 |
+
| And | |
|
16 |
+
| ArgMax | |
|
17 |
+
| ArgMin | |
|
18 |
+
| Asin | Not Supported |
|
19 |
+
| Asinh | Not Supported |
|
20 |
+
| Atan | Not Supported |
|
21 |
+
| Atanh | Not Supported |
|
22 |
+
| AveragePool | |
|
23 |
+
| BatchNormalization | |
|
24 |
+
| Bernoulli | Not Supported |
|
25 |
+
| BitShift | Not Supported |
|
26 |
+
| BitwiseAnd | Not Supported |
|
27 |
+
| BitwiseNot | Not Supported |
|
28 |
+
| BitwiseOr | Not Supported |
|
29 |
+
| BitwiseXor | Not Supported |
|
30 |
+
| BlackmanWindow | Not Supported |
|
31 |
+
| Cast | |
|
32 |
+
| CastLike | Not Supported |
|
33 |
+
| Ceil | Not Supported |
|
34 |
+
| Celu | Not Supported |
|
35 |
+
| CenterCropPad | Not Supported |
|
36 |
+
| Clip | |
|
37 |
+
| Col2Im | Not Supported |
|
38 |
+
| Compress | Not Supported |
|
39 |
+
| Concat | |
|
40 |
+
| ConcatFromSequence | Not Supported |
|
41 |
+
| Constant | |
|
42 |
+
| ConstantOfShape | |
|
43 |
+
| Conv | |
|
44 |
+
| ConvInteger | Not Supported |
|
45 |
+
| ConvTranspose | |
|
46 |
+
| Cos | |
|
47 |
+
| Cosh | Not Supported |
|
48 |
+
| CumSum | Not Supported |
|
49 |
+
| DeformConv | Not Supported |
|
50 |
+
| DepthToSpace | |
|
51 |
+
| DequantizeLinear | |
|
52 |
+
| Det | Not Supported |
|
53 |
+
| DFT | Not Supported |
|
54 |
+
| Div | |
|
55 |
+
| Dropout | |
|
56 |
+
| DynamicQuantizeLinear | Not Supported |
|
57 |
+
| Einsum | Not Supported |
|
58 |
+
| Elu | |
|
59 |
+
| Equal | |
|
60 |
+
| Erf | |
|
61 |
+
| Exp | |
|
62 |
+
| Expand | |
|
63 |
+
| EyeLike | only support constant input |
|
64 |
+
| Flatten | |
|
65 |
+
| Floor | |
|
66 |
+
| Gather | |
|
67 |
+
| GatherElements | |
|
68 |
+
| GatherND | Not Supported |
|
69 |
+
| Gemm | |
|
70 |
+
| GlobalAveragePool | |
|
71 |
+
| GlobalLpPool | Not Supported |
|
72 |
+
| GlobalMaxPool | |
|
73 |
+
| Greater | |
|
74 |
+
| GreaterOrEqual | |
|
75 |
+
| GridSample | Not Supported |
|
76 |
+
| GroupNormalization | Not Supported |
|
77 |
+
| GRU | batchsize: 1 |
|
78 |
+
| HammingWindow | Not Supported |
|
79 |
+
| HannWindow | Not Supported |
|
80 |
+
| Hardmax | Not Supported |
|
81 |
+
| HardSigmoid | |
|
82 |
+
| HardSwish | |
|
83 |
+
| Identity | |
|
84 |
+
| If | only support constant input |
|
85 |
+
| InstanceNormalization | |
|
86 |
+
| IsInf | Not Supported |
|
87 |
+
| IsNaN | Not Supported |
|
88 |
+
| LayerNormalization | |
|
89 |
+
| LeakyRelu | |
|
90 |
+
| Less | |
|
91 |
+
| LessOrEqual | |
|
92 |
+
| Log | |
|
93 |
+
| LogSoftmax | batchsize: 1 |
|
94 |
+
| Loop | Not Supported |
|
95 |
+
| LpNormalization | |
|
96 |
+
| LpPool | Not Supported |
|
97 |
+
| LRN | |
|
98 |
+
| LSTM | |
|
99 |
+
| MatMul | |
|
100 |
+
| MatMulInteger | Not Supported |
|
101 |
+
| Max | |
|
102 |
+
| MaxPool | |
|
103 |
+
| MaxRoiPool | |
|
104 |
+
| MaxUnpool | |
|
105 |
+
| Mean | Not Supported |
|
106 |
+
| MeanVarianceNormalization | |
|
107 |
+
| MelWeightMatrix | Not Supported |
|
108 |
+
| Min | |
|
109 |
+
| Mish | |
|
110 |
+
| Mod | |
|
111 |
+
| Mul | |
|
112 |
+
| Multinomial | Not Supported |
|
113 |
+
| Neg | Not Supported |
|
114 |
+
| NegativeLogLikelihoodLoss | Not Supported |
|
115 |
+
| NonMaxSuppression | Not Supported |
|
116 |
+
| NonZero | Not Supported |
|
117 |
+
| Not | Not Supported |
|
118 |
+
| OneHot | Not Supported |
|
119 |
+
| Optional | Not Supported |
|
120 |
+
| OptionalGetElement | Not Supported |
|
121 |
+
| OptionalHasElement | Not Supported |
|
122 |
+
| Or | Not Supported |
|
123 |
+
| Pad | |
|
124 |
+
| Pow | |
|
125 |
+
| PRelu | |
|
126 |
+
| QLinearConv | Not Supported |
|
127 |
+
| QLinearMatMul | Not Supported |
|
128 |
+
| QuantizeLinear | |
|
129 |
+
| RandomNormal | Not Supported |
|
130 |
+
| RandomNormalLike | Not Supported |
|
131 |
+
| RandomUniform | Not Supported |
|
132 |
+
| RandomUniformLike | Not Supported |
|
133 |
+
| Range | Not Supported |
|
134 |
+
| Reciprocal | Not Supported |
|
135 |
+
| ReduceL1 | Not Supported |
|
136 |
+
| ReduceL2 | Not Supported |
|
137 |
+
| ReduceLogSum | Not Supported |
|
138 |
+
| ReduceLogSumExp | Not Supported |
|
139 |
+
| ReduceMax | |
|
140 |
+
| ReduceMean | |
|
141 |
+
| ReduceMin | |
|
142 |
+
| ReduceProd | Not Supported |
|
143 |
+
| ReduceSum | |
|
144 |
+
| ReduceSumSquare | Not Supported |
|
145 |
+
| Relu | |
|
146 |
+
| Reshape | |
|
147 |
+
| Resize | mode: nearest2d/bilinear |
|
148 |
+
| ReverseSequence | |
|
149 |
+
| RNN | Not Supported |
|
150 |
+
| RoiAlign | pool type: average<br />batchsize: 1 |
|
151 |
+
| Round | Not Supported |
|
152 |
+
| Scan | Not Supported |
|
153 |
+
| ScatterElements | Not Supported |
|
154 |
+
| ScatterND | |
|
155 |
+
| Selu | Not Supported |
|
156 |
+
| SequenceAt | Not Supported |
|
157 |
+
| SequenceConstruct | Not Supported |
|
158 |
+
| SequenceEmpty | Not Supported |
|
159 |
+
| SequenceErase | Not Supported |
|
160 |
+
| SequenceInsert | Not Supported |
|
161 |
+
| SequenceLength | Not Supported |
|
162 |
+
| SequenceMap | Not Supported |
|
163 |
+
| Shape | |
|
164 |
+
| Shrink | Not Supported |
|
165 |
+
| Sigmoid | |
|
166 |
+
| Sign | Not Supported |
|
167 |
+
| Sin | |
|
168 |
+
| Sinh | Not Supported |
|
169 |
+
| Size | |
|
170 |
+
| Slice | batchsize: 1 |
|
171 |
+
| Softmax | batchsize: 1 |
|
172 |
+
| SoftmaxCrossEntropyLoss | Not Supported |
|
173 |
+
| Softplus | |
|
174 |
+
| Softsign | Not Supported |
|
175 |
+
| SpaceToDepth | |
|
176 |
+
| Split | |
|
177 |
+
| SplitToSequence | Not Supported |
|
178 |
+
| Sqrt | |
|
179 |
+
| Squeeze | |
|
180 |
+
| STFT | Not Supported |
|
181 |
+
| StringNormalizer | Not Supported |
|
182 |
+
| Sub | |
|
183 |
+
| Sum | Not Supported |
|
184 |
+
| Tan | Not Supported |
|
185 |
+
| Tanh | |
|
186 |
+
| TfIdfVectorizer | Not Supported |
|
187 |
+
| ThresholdedRelu | Not Supported |
|
188 |
+
| Tile | batchsize: 1<br />not support broadcast |
|
189 |
+
| TopK | Not Supported |
|
190 |
+
| Transpose | |
|
191 |
+
| Trilu | Not Supported |
|
192 |
+
| Unique | Not Supported |
|
193 |
+
| Unsqueeze | |
|
194 |
+
| Where | |
|
195 |
+
| Xor | Not Supported |
|
196 |
+
|
197 |
+
## Pytorch OPs supported by RKNN Toolkit2
|
198 |
+
|
199 |
+
The Pytorch version supported by RKNN Toolkit2 is >1.6.0, models generated by other versions may not support.
|
200 |
+
The list of Pytorch OPs supported by RKNN Toolkit2 is as follows:
|
201 |
+
|
202 |
+
| **Operators** | **Remarks** |
|
203 |
+
| ----------------------------- | ---------------------------------- |
|
204 |
+
| aten::_convolution | same as onnx Conv |
|
205 |
+
| aten::abs | Not supported |
|
206 |
+
| aten::abs_ | Not supported |
|
207 |
+
| aten::adaptive_avg_pool1d | Not supported |
|
208 |
+
| aten::adaptive_avg_pool2d | same as onnx AveragePool |
|
209 |
+
| aten::adaptive_max_pool1d | Not supported |
|
210 |
+
| aten::adaptive_max_pool2d | same as onnx MaxPool |
|
211 |
+
| aten::add | same as onnx Add |
|
212 |
+
| aten::add_ | |
|
213 |
+
| aten::addmm | same as onnx Gemm |
|
214 |
+
| aten::affine_grid_generator | Not supported |
|
215 |
+
| aten::alpha_dropout | |
|
216 |
+
| aten::alpha_dropout_ | Not supported |
|
217 |
+
| aten::arange | Not supported |
|
218 |
+
| aten::avg_pool1d | Not supported |
|
219 |
+
| aten::avg_pool2d | same as onnx AveragePool |
|
220 |
+
| aten::avg_pool3d | Not supported |
|
221 |
+
| aten::batch_norm | same as onnx BatchNormalization |
|
222 |
+
| aten::bmm | same as onnx MatMul |
|
223 |
+
| aten::cat | same as onnx Concat |
|
224 |
+
| aten::celu | Not supported |
|
225 |
+
| aten::celu_ | Not supported |
|
226 |
+
| aten::chunk | |
|
227 |
+
| aten::clamp | |
|
228 |
+
| aten::clamp_ | |
|
229 |
+
| aten::clamp_max | Not supported |
|
230 |
+
| aten::clamp_max_ | Not supported |
|
231 |
+
| aten::clamp_min | |
|
232 |
+
| aten::clamp_min_ | Not supported |
|
233 |
+
| aten::clone | |
|
234 |
+
| aten::constant_pad_nd | same as onnx Pad |
|
235 |
+
| aten::contiguous | |
|
236 |
+
| aten::copy | |
|
237 |
+
| aten::cos | Not supported |
|
238 |
+
| aten::cos_ | Not supported |
|
239 |
+
| aten::cumsum | Not supported |
|
240 |
+
| aten::detach | |
|
241 |
+
| aten::detach_ | Not supported |
|
242 |
+
| aten::div | same as onnx Div |
|
243 |
+
| aten::div_ | |
|
244 |
+
| aten::dropout | |
|
245 |
+
| aten::dropout_ | |
|
246 |
+
| aten::einsum | Not supported |
|
247 |
+
| aten::elu | same as onnx Elu |
|
248 |
+
| aten::elu_ | |
|
249 |
+
| aten::embedding | same as onnx Gather |
|
250 |
+
| aten::empty | |
|
251 |
+
| aten::eq | Not supported |
|
252 |
+
| aten::eq_ | Not supported |
|
253 |
+
| aten::erf | Not supported |
|
254 |
+
| aten::erf_ | Not supported |
|
255 |
+
| aten::erfc | Not supported |
|
256 |
+
| aten::erfc_ | Not supported |
|
257 |
+
| aten::exp | |
|
258 |
+
| aten::exp_ | |
|
259 |
+
| aten::expand | |
|
260 |
+
| aten::expand_as | Not supported |
|
261 |
+
| aten::expm1 | Not supported |
|
262 |
+
| aten::expm1_ | Not supported |
|
263 |
+
| aten::feature_dropout | |
|
264 |
+
| aten::feature_dropout_ | Not supported |
|
265 |
+
| aten::flatten | |
|
266 |
+
| aten::flip | Not supported |
|
267 |
+
| aten::floor | Not supported |
|
268 |
+
| aten::floor_ | Not supported |
|
269 |
+
| aten::floor_divide | Not supported |
|
270 |
+
| aten::floor_divide_ | Not supported |
|
271 |
+
| aten::gather | Not supported |
|
272 |
+
| aten::ge | Not supported |
|
273 |
+
| aten::ge_ | Not supported |
|
274 |
+
| aten::gelu | |
|
275 |
+
| aten::gelu_ | Not supported |
|
276 |
+
| aten::grid_sampler | Not supported |
|
277 |
+
| aten::gru | |
|
278 |
+
| aten::gt | |
|
279 |
+
| aten::gt_ | Not supported |
|
280 |
+
| aten::hardshrink | Not supported |
|
281 |
+
| aten::hardshrink_ | Not supported |
|
282 |
+
| aten::hardswish | same as onnx HardSwish |
|
283 |
+
| aten::hardswish_ | |
|
284 |
+
| aten::hardtanh | |
|
285 |
+
| aten::hardtanh_ | |
|
286 |
+
| aten::index | Not supported |
|
287 |
+
| aten::index_put | Not supported |
|
288 |
+
| aten::index_put_ | Not supported |
|
289 |
+
| aten::instance_norm | same as onnx InstanceNormalization |
|
290 |
+
| aten::Int | |
|
291 |
+
| aten::layer_norm | |
|
292 |
+
| aten::le | Not supported |
|
293 |
+
| aten::le_ | Not supported |
|
294 |
+
| aten::leaky_relu | same as onnx LeakyRelu |
|
295 |
+
| aten::leaky_relu_ | |
|
296 |
+
| aten::lerp | Not supported |
|
297 |
+
| aten::lerp_ | Not supported |
|
298 |
+
| aten::log | Not supported |
|
299 |
+
| aten::log_ | Not supported |
|
300 |
+
| aten::log10 | Not supported |
|
301 |
+
| aten::log10_ | Not supported |
|
302 |
+
| aten::log1p | Not supported |
|
303 |
+
| aten::log1p_ | Not supported |
|
304 |
+
| aten::log2 | Not supported |
|
305 |
+
| aten::log2_ | Not supported |
|
306 |
+
| aten::log_sigmoid | Not supported |
|
307 |
+
| aten::log_softmax | Not supported |
|
308 |
+
| aten::linear | same as onnx Gemm |
|
309 |
+
| aten::lstm | same as onnx LSTM |
|
310 |
+
| aten::lt | |
|
311 |
+
| aten::lt_ | Not supported |
|
312 |
+
| aten::matmul | same as onnx MatMul |
|
313 |
+
| aten::max | |
|
314 |
+
| aten::maximum | |
|
315 |
+
| aten::max_ | Not supported |
|
316 |
+
| aten::max_pool1d | same as onnx MaxPool |
|
317 |
+
| aten::max_pool1d_with_indices | |
|
318 |
+
| aten::max_pool2d | same as onnx MaxPool |
|
319 |
+
| aten::max_pool2d_with_indices | |
|
320 |
+
| aten::mean | same as onnx ReduceMean |
|
321 |
+
| aten::meshgrid | Not supported |
|
322 |
+
| aten::min | |
|
323 |
+
| aten::minimum | |
|
324 |
+
| aten::min_ | Not supported |
|
325 |
+
| aten::mish | |
|
326 |
+
| aten::mm | same as onnx MatMul |
|
327 |
+
| aten::mul | same as onnx Mul |
|
328 |
+
| aten::mul_ | |
|
329 |
+
| aten::narrow | same as onnx Slice |
|
330 |
+
| aten::ne | |
|
331 |
+
| aten::ne_ | Not supported |
|
332 |
+
| aten::neg | Not supported |
|
333 |
+
| aten::neg_ | Not supported |
|
334 |
+
| aten::new_full | Not supported |
|
335 |
+
| aten::new_zeros | Not supported |
|
336 |
+
| aten::nonzero | Not supported |
|
337 |
+
| aten::norm | Not supported |
|
338 |
+
| aten::ones | |
|
339 |
+
| aten::ones_like | |
|
340 |
+
| aten::pad | Not supported |
|
341 |
+
| aten::permute | same as onnx Transpose |
|
342 |
+
| aten::pow | |
|
343 |
+
| aten::pow_ | Not supported |
|
344 |
+
| aten::prelu | same as onnx PRelu |
|
345 |
+
| aten::prelu_ | Not supported |
|
346 |
+
| aten::prod | |
|
347 |
+
| aten::reciprocal | |
|
348 |
+
| aten::reciprocal_ | Not supported |
|
349 |
+
| aten::reflection_pad1d | |
|
350 |
+
| aten::reflection_pad2d | |
|
351 |
+
| aten::relu | same as onnx Relu |
|
352 |
+
| aten::relu6 | same as onnx Relu |
|
353 |
+
| aten::relu_ | |
|
354 |
+
| aten::relu6_ | |
|
355 |
+
| aten::repeat | |
|
356 |
+
| aten::reshape | |
|
357 |
+
| aten::reshape_ | Not supported |
|
358 |
+
| torchvision::roi_align | Not supported |
|
359 |
+
| aten::rsqrt | Not supported |
|
360 |
+
| aten::rsqrt_ | Not supported |
|
361 |
+
| aten::ScalarImplicit | |
|
362 |
+
| aten::select | |
|
363 |
+
| aten::selu | Not supported |
|
364 |
+
| aten::selu_ | Not supported |
|
365 |
+
| aten::sigmoid | same as onnx Sigmoid |
|
366 |
+
| aten::sigmoid_ | |
|
367 |
+
| aten::silu | |
|
368 |
+
| aten::silu_ | |
|
369 |
+
| aten::sin | Not supported |
|
370 |
+
| aten::sin_ | Not supported |
|
371 |
+
| aten::size | |
|
372 |
+
| aten::slice | same as onnx Slice |
|
373 |
+
| aten::softmax | same as onnx Softmax |
|
374 |
+
| aten::softplus | |
|
375 |
+
| aten::softshrink | Not supported |
|
376 |
+
| aten::sort | Not supported |
|
377 |
+
| aten::split | same as onnx Split |
|
378 |
+
| aten::split_with_sizes | |
|
379 |
+
| aten::sqrt | Not supported |
|
380 |
+
| aten::sqrt_ | Not supported |
|
381 |
+
| aten::squeeze | |
|
382 |
+
| aten::squeeze_ | Not supported |
|
383 |
+
| aten::stack | |
|
384 |
+
| aten::sub | same as onnx Sub |
|
385 |
+
| aten::sub_ | |
|
386 |
+
| aten::sum | same as onnx ReduceSum |
|
387 |
+
| aten::t | |
|
388 |
+
| aten::t_ | Not supported |
|
389 |
+
| aten::tanh | |
|
390 |
+
| aten::tanh_ | |
|
391 |
+
| aten::threshold | |
|
392 |
+
| aten::threshold_ | |
|
393 |
+
| aten::to | |
|
394 |
+
| aten::topk | Not supported |
|
395 |
+
| aten::transpose | |
|
396 |
+
| aten::transpose_ | |
|
397 |
+
| aten::true_divide | same as onnx Div |
|
398 |
+
| aten::true_divide_ | Not supported |
|
399 |
+
| aten::type_as | |
|
400 |
+
| aten::unfold | Not supported |
|
401 |
+
| aten::unsqueeze | |
|
402 |
+
| aten::upsample_bilinear2d | |
|
403 |
+
| aten::upsample_nearest2d | |
|
404 |
+
| aten::view | |
|
405 |
+
| aten::view_ | Not supported |
|
406 |
+
| aten::view_as | Not supported |
|
407 |
+
| aten::view_as_ | Not supported |
|
408 |
+
| aten::where | |
|
409 |
+
| aten::zero_ | Not supported |
|
410 |
+
| aten::zeros | |
|
411 |
+
| aten::zeros_like | |
|
412 |
+
|
413 |
+
|
414 |
+
|
415 |
+
|
416 |
+
## Caffe OPs supported by RKNN Toolkit2
|
417 |
+
|
418 |
+
Caffe protocols RKNN Toolkit2 uses only based on the officially modified protocol of berkeley.
|
419 |
+
The protocol based on the official revision of berkeley comes from [berkeley caffe](https://github.com/BVLC/caffe/tree/master/src/caffe/proto 'Berkeley Caffe'), commit hash is 21d0608. On this basis RKNN Toolkit2 have added some OPs.
|
420 |
+
Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 is as follows:
|
421 |
+
|
422 |
+
| **Operators** | **Remarks** |
|
423 |
+
| ---------------------- | ------------------------------------------------------------------------------------------------------------- |
|
424 |
+
| BatchNorm | same as onnx BatchNormalization |
|
425 |
+
| bn (BatchNorm + Scale) | same as onnx BatchNormalization according to https://github.com/TimoSaemann/caffe-segnet-cudnn5 |
|
426 |
+
| BNLL | |
|
427 |
+
| Concat | same as onnx Concat |
|
428 |
+
| Convolution | same as onnx Conv |
|
429 |
+
| ConvolutionDepthwise | kernel height/width: [1, 8]<br />others same as onnx Conv |
|
430 |
+
| Crop | |
|
431 |
+
| Deconvolution | same as ConvTranspose |
|
432 |
+
| Dropout | |
|
433 |
+
| Eltwise | |
|
434 |
+
| Flatten | |
|
435 |
+
| HardSigmoid | |
|
436 |
+
| InnerProduct | same as onnx Gemm |
|
437 |
+
| LRN | same as onnx LRN |
|
438 |
+
| Lstm | same as onnx LSTM according to https://github.com/xmfbit/warpctc-caffe |
|
439 |
+
| Normalize | |
|
440 |
+
| Permute | same as onnx Transpose |
|
441 |
+
| Power | |
|
442 |
+
| Pooling | same as onnx pooling |
|
443 |
+
| PRelu | same as onnx PRelu |
|
444 |
+
| Proposal | batch: 1 |
|
445 |
+
| Reduction | output dims <= 4 |
|
446 |
+
| Relu | same as onnx Relu |
|
447 |
+
| Relu6 | same as onnx Clip |
|
448 |
+
| Reorg | |
|
449 |
+
| Reshape | same as onnx Reshape |
|
450 |
+
| Resize | bilinear; nearest |
|
451 |
+
| Reverse | |
|
452 |
+
| ROIPooling | same as MaxRoiPool according to https://github.com/twmht/caffe-pva-faster-rcnn |
|
453 |
+
| Scale | same as onnx Mul |
|
454 |
+
| Sigmoid | same as onnx Sigmoid |
|
455 |
+
| Slice | same as onnx Split |
|
456 |
+
| Softmax | same as onnx Softmax |
|
457 |
+
| Split | same as onnx Slice |
|
458 |
+
| TanH | same as onnx TanH |
|
459 |
+
| Tile | same as onnx Tile |
|
460 |
+
| Transpose | same as onnx Transpose |
|
461 |
+
| Upsample | according to https://github.com/SeanQ88/caffe_upsample and https://github.com/TimoSaemann/caffe-segnet-cudnn5 |
|
462 |
+
|
463 |
+
|
464 |
+
## TensorFlow OPs supported by RKNN Toolkit2
|
465 |
+
|
466 |
+
The pb files (contain OPs belows) generated by TensorFlow version 1.12 - 1.15 for 1.x and 2.3 - 2.5 for 2.x are supported by RKNN Toolkit2. For more information on TensorFlow version compatibility, please refer to [tensorflow official instructions on OP version](https://www.tensorflow.org/guide/versions 'Tensorflow official instructions on OP version') .
|
467 |
+
The list of TensorFlow OPs supported by RKNN Toolkit2 is as follows:
|
468 |
+
|
469 |
+
| **Operators** | **Remarks** |
|
470 |
+
| --------------------- | --------------------------------------------------------- |
|
471 |
+
| Add | same as onnx Add |
|
472 |
+
| AvgPool | same as onnx AveragePool |
|
473 |
+
| Concat | same as onnx Concat |
|
474 |
+
| Conv2D | same as onnx Conv |
|
475 |
+
| DepthToSpace | |
|
476 |
+
| DepthwiseConv2d | kernel height/width: [1, 8]<br />others same as onnx Conv |
|
477 |
+
| Div | same as onnx Div |
|
478 |
+
| Dropout | |
|
479 |
+
| Flatten | |
|
480 |
+
| LeakyRelu | same as onnx LeakyRelu |
|
481 |
+
| Less | same as onnx Less |
|
482 |
+
| LRN | |
|
483 |
+
| MatMul | |
|
484 |
+
| MaxPool | same as onnx MaxPool |
|
485 |
+
| Mean | output dims <= 4 |
|
486 |
+
| Pad | same as onnx Pad |
|
487 |
+
| Relu | same as onnx Relu |
|
488 |
+
| Reshape | |
|
489 |
+
| ResizeBilinear | |
|
490 |
+
| ResizeNearestNeighbor | |
|
491 |
+
| Sigmoid | |
|
492 |
+
| Slice | |
|
493 |
+
| Softmax | |
|
494 |
+
| Softplus | same as onnx Softplus |
|
495 |
+
| SpaceToDepth | |
|
496 |
+
| Split | |
|
497 |
+
| Squeeze | |
|
498 |
+
| StridedSlice | |
|
499 |
+
| Tanh | same as onnx TanH |
|
500 |
+
| Transpose | |
|
501 |
+
|
502 |
+
## Darknet OPs supported by RKNN Toolkit2
|
503 |
+
The list of Darknet OPs supported by RKNN Toolkit2 is as follows:
|
504 |
+
|
505 |
+
| **Operators** | **Remarks** |
|
506 |
+
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
507 |
+
| add | same as onnx Add |
|
508 |
+
| batchnormalize | same as onnx BatchNormalization |
|
509 |
+
| concat | same as onnx Concat |
|
510 |
+
| convolutional | same as onnx Conv |
|
511 |
+
| depthwise_convolutional | kernel height/width: [1, 8]<br />others same as onnx Conv |
|
512 |
+
| fullconnect | |
|
513 |
+
| leakyrelu | same as onnx LeakyRelu |
|
514 |
+
| mish | |
|
515 |
+
| pooling | **AveragePool**: same as onnx AveragePool <br /> **GlobalAveragePool**: same as onnx GlobalAveragePool <br /> **MaxPool/GlobalMaxPool**: same as onnx MaxPool/GlobalMaxPool |
|
516 |
+
| route | |
|
517 |
+
| shortcut | |
|
518 |
+
| softmax | |
|
519 |
+
| upsampling | |
|
doc/Using RKNN-ToolKit2 in WSL.md
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Using RKNN-ToolKit2 in WSL
|
2 |
+
|
3 |
+
## 1. Installing WSL on Windows Host
|
4 |
+
- You can refer to the following link for installing WSL: https://learn.microsoft.com/en-us/windows/wsl/install
|
5 |
+
|
6 |
+
## 2. Using RKNN-Toolkit2 in WSL
|
7 |
+
1. Refer to the document[《Rockchip_RKNPU_Quick_Start》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.0.0beta0_EN.pdf) to install the RKNN-ToolKit2 environment in WSL
|
8 |
+
2. Refer to the document[《Rockchip_RKNPU_User_Guide》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_EN.pdf) for model conversion, quantization, and other operations in WSL.
|
9 |
+
|
10 |
+
## 3. Using RKNN-Toolkit2 for Board Debugging in WSL
|
11 |
+
|
12 |
+
### 3.1. Installing adb in WSL Terminal
|
13 |
+
```
|
14 |
+
sudo apt update
|
15 |
+
sudo apt install adb
|
16 |
+
```
|
17 |
+
|
18 |
+
### 3.2 Connecting the Device in WSL
|
19 |
+
You can choose to connect the device through Ethernet or USB.
|
20 |
+
|
21 |
+
#### 3.2.1 Ethernet Connection
|
22 |
+
```
|
23 |
+
# 1. Connect the device using Ethernet cable.
|
24 |
+
|
25 |
+
# 2. In WSL, use adb connect to connect to the device.
|
26 |
+
adb connect <IP address:port>
|
27 |
+
```
|
28 |
+
`IP address` is the IP address of the board.
|
29 |
+
|
30 |
+
|
31 |
+
#### 3.2.2 USB Connection
|
32 |
+
```
|
33 |
+
# 1. Connect the device to Windows via USB.
|
34 |
+
|
35 |
+
# 2. Use the adbkit tool in Windows to convert USB to TCP.
|
36 |
+
npm install --save adbkit
|
37 |
+
adbkit usb-device-to-tcp <device_id> -p <port>
|
38 |
+
|
39 |
+
# Note: Configure WSL to access Windows network.
|
40 |
+
|
41 |
+
# 3. In WSL, use adb connect to connect to the device.
|
42 |
+
adb connect <IP address:port>
|
43 |
+
```
|
44 |
+
- `device_id` can be obtained by running the `adb devices` command in Windows (adb tool must be installed in Windows).
|
45 |
+
- `IP address` is the IP address of the Windows host.
|
46 |
+
|
47 |
+
### 3.3 Using RKNN-Toolkit2 for Board Debugging
|
48 |
+
Refer to the document [《Rockchip_RKNPU_User_Guide》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_EN.pdf) for board inference, accuracy analysis, and other operations in WSL.
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
## NOte:
|
53 |
+
1. It is recommended to install WSL2 with Ubuntu version 22.04, which has been verified to work (other versions are theoretically feasible but not tested).
|
54 |
+
2. If you encounter the "ImportError: libGL.so.1: cannot open shared object file: No such file or directory" error while using RKNN-ToolKit2 in WSL, execute the following code to resolve it:
|
55 |
+
```
|
56 |
+
1. Install the required library:
|
57 |
+
sudo apt update
|
58 |
+
sudo apt install libgl1-mesa-glx
|
59 |
+
|
60 |
+
2. Set the environment variable:
|
61 |
+
echo 'export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa' >> ~/.bashrc
|
62 |
+
source ~/.bashrc
|
63 |
+
```
|
doc/WSL中使用RKNN_ToolKit2.md
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# WSL 中 使用RKNN-ToolKit2
|
2 |
+
|
3 |
+
## 1. Windows主机安装WSL
|
4 |
+
- 可参考 https://learn.microsoft.com/zh-cn/windows/wsl/install
|
5 |
+
|
6 |
+
## 2. WSL 中使用RKNN-Toolkit2
|
7 |
+
1. 参考[《Rockchip_RKNPU_Quick_Start手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.0.0beta0_CN.pdf)在 WSL 中安装RKNN-ToolKit2环境
|
8 |
+
2. 参考[《Rockchip_RKNPU_User_Guide手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_CN.pdf)在 WSL 进行模型转换、量化等操作
|
9 |
+
|
10 |
+
## 3. WSL 中使用RKNN-Toolkit2进行连板调试
|
11 |
+
|
12 |
+
### 3.1. WSL 终端安装adb
|
13 |
+
```
|
14 |
+
sudo apt update
|
15 |
+
sudo apt install adb
|
16 |
+
```
|
17 |
+
|
18 |
+
### 3.2 WSL 连接设备
|
19 |
+
可选择通过网线或USB进行设备连接
|
20 |
+
|
21 |
+
#### 3.2.1 通过网线连接
|
22 |
+
```
|
23 |
+
# 1. 使用网线连接设备
|
24 |
+
|
25 |
+
# 2. 在 WSL 中使用 adb connect 连接设备
|
26 |
+
adb connect <IP地址:端口号>
|
27 |
+
```
|
28 |
+
`IP地址` 为板子的IP地址
|
29 |
+
|
30 |
+
|
31 |
+
#### 3.2.2 通过USB连接
|
32 |
+
```
|
33 |
+
# 1. 在 Windows 上通过USB连接设备
|
34 |
+
|
35 |
+
# 2. 在 Windows 上使用adbkit工具,将USB转为TCP
|
36 |
+
npm install --save adbkit
|
37 |
+
adbkit usb-device-to-tcp <device_id> -p <端口号>
|
38 |
+
|
39 |
+
# 注:配置WSL可以访问Windows的网络
|
40 |
+
|
41 |
+
# 3. 在 WSL 中使用 adb connect 连接设备
|
42 |
+
adb connect <IP地址:端口号>
|
43 |
+
```
|
44 |
+
- `device_id`可通过在Windows中使用`adb devices`命令查看 (需要Windows中已安装adb工具)
|
45 |
+
- `IP地址` 为 Windows主机 的IP地址
|
46 |
+
|
47 |
+
### 3.3 使用RKNN-ToolKit2进行连板调试
|
48 |
+
参考[《Rockchip_RKNPU_User_Guide手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_CN.pdf)在 WSL 进行连板推理、连板精度分析等操作
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
## 注:
|
53 |
+
1. 推荐安装 WSL2,Ubuntu版本号为22.04 已验证可行(其余版本未验证,理论可行)
|
54 |
+
2. 在WSL使用RKNN-ToolKit2中若出现 "ImportError: libGL.so.1: cannot open shared object file: No such file or directory",请执行以下代码解决
|
55 |
+
```
|
56 |
+
1. 安装对应库
|
57 |
+
sudo apt update
|
58 |
+
sudo apt install libgl1-mesa-glx
|
59 |
+
|
60 |
+
2. 设置环境变量
|
61 |
+
echo 'export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa' >> ~/.bashrc
|
62 |
+
source ~/.bashrc
|
63 |
+
```
|
doc/rknn_server_proxy.md
ADDED
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**目录**
|
2 |
+
|
3 |
+
[TOC]
|
4 |
+
|
5 |
+
## 1. 连板调试简介
|
6 |
+
RKNN Toolkit2的连板功能一般需要更新板端的 rknn_server 和 librknnrt.so/librknnmrt.so,并且手动启动 rknn_server 才能正常工作。
|
7 |
+
rknn_server: 是一个运行在板子上的后台代理服务,用于接收PC通过USB传输过来的协议,然后执行板端runtime对应的接口,并返回结果给PC。
|
8 |
+
|
9 |
+
- librknnrt.so: 是一个板端的RKNPU Runtime库(非RV1103/RV1106/RV1103B平台不适用)。
|
10 |
+
- librknnmrt.so: 是专用于RV1103/RV1106/RV1103B平台的RKNPU Runtime库。
|
11 |
+
|
12 |
+
开机后通过ps命令查看rknn_server进程是否已存在,如果已存在,则不需要手动启动,否则需要手动启动。
|
13 |
+
|
14 |
+
## 2. 环境要求
|
15 |
+
### 2.1 硬件环境
|
16 |
+
本文档适用如下硬件平台:
|
17 |
+
|
18 |
+
- RV1103
|
19 |
+
- RV1103B
|
20 |
+
- RV1106
|
21 |
+
- RK3562
|
22 |
+
- RK3566系列
|
23 |
+
- RK3568系列
|
24 |
+
- RK3576系列
|
25 |
+
- RK3588系列
|
26 |
+
|
27 |
+
### 2.2 软件环境
|
28 |
+
- 若使用动态形状输入RKNN模型,要求rknn_server和RKNPU Runtime库版本>=1.5.0。
|
29 |
+
- 若使用大于2GB的模型,要求rknn_server版本>=2.0.0b0。
|
30 |
+
- 在RV1103/RV1106/RV1103B等小内存平台上,建议rknn_server版本>=2.1.0。
|
31 |
+
|
32 |
+
|
33 |
+
## 3. rknn_server存放目录
|
34 |
+
rknn_server存放在runtime目录下, 请根据板子上的系统选择相应版本的rknn_server,不同芯片和系统对应的rknn_server路径如下:
|
35 |
+
### 3.1 Android平台
|
36 |
+
|系统|路径|
|
37 |
+
|-----|-----|
|
38 |
+
|32-bit Android|runtime/Android/rknn_server/arm/rknn_server|
|
39 |
+
|64-bit Android|runtime/Android/rknn_server/arm64/rknn_server|
|
40 |
+
|
41 |
+
|
42 |
+
### 3.2 Linux平台
|
43 |
+
|
44 |
+
|芯片|系统|路径|
|
45 |
+
|-----|-----|-----|
|
46 |
+
|RV1103/RV1106/RV1103B|32-bit Linux|runtime/Linux/rknn_server/armhf-uclibc/usr/bin/rknn_server|
|
47 |
+
|其他芯片|32-bit Linux|runtime/Linux/rknn_server/armhf/usr/bin/rknn_server|
|
48 |
+
|其他芯片|64-bit Linux|runtime/Linux/rknn_server/aarch64/usr/bin/rknn_server|
|
49 |
+
|
50 |
+
## 4. 启动步骤
|
51 |
+
### 4.1 Android平台
|
52 |
+
进入rknpu2工程的根目录,在PC端执行下列命令启动代理服务:
|
53 |
+
1. 重新挂载系统分区,使系统分区重新可写
|
54 |
+
```
|
55 |
+
adb root && adb remount
|
56 |
+
```
|
57 |
+
2. 更新代理程序
|
58 |
+
```
|
59 |
+
// 64-bit Android系统
|
60 |
+
adb push runtime/Android/rknn_server/arm64/rknn_server /vendor/bin/
|
61 |
+
// 32-bit Android系统
|
62 |
+
adb push runtime/Android/rknn_server/arm/rknn_server /vendor/bin/
|
63 |
+
```
|
64 |
+
3. 更新RKNPU runtime库
|
65 |
+
```
|
66 |
+
// 64-bit Android系统
|
67 |
+
adb push runtime/Android/librknn_api/arm64-v8a/librknnrt.so /vendor/lib64
|
68 |
+
// 32-bit Android系统
|
69 |
+
adb push runtime/Android/librknn_api/armeabi-v7a/librknnrt.so /vendor/lib
|
70 |
+
```
|
71 |
+
4. 修改代理程序权限
|
72 |
+
```
|
73 |
+
adb shell chmod +x /vendor/bin/rknn_server
|
74 |
+
```
|
75 |
+
5. 启动代理服务
|
76 |
+
```
|
77 |
+
adb shell "killall rknn_server"
|
78 |
+
adb shell "nohup /vendor/bin/rknn_server >/dev/null"&
|
79 |
+
```
|
80 |
+
6. 检查代理服务是否启动成功:
|
81 |
+
```
|
82 |
+
adb shell ps -ef|grep rknn_server
|
83 |
+
```
|
84 |
+
查看是否有`rknn_server`的进程id,如果存在表示代理服务启动成功;否则请在板子上手动启动代理服务,步骤如下:
|
85 |
+
adb shell命令**进入板子shell界面**后,执行下列命令启动代理服务
|
86 |
+
|
87 |
+
```
|
88 |
+
nohup /vendor/bin/rknn_server > /dev/null&
|
89 |
+
```
|
90 |
+
|
91 |
+
### 4.2 Linux平台(非RV1103/RV1106/RV1103B)
|
92 |
+
1. 更新代理程序
|
93 |
+
```
|
94 |
+
// 64-bit Linux系统
|
95 |
+
adb push runtime/Linux/rknn_server/aarch64/usr/bin/rknn_server /usr/bin/
|
96 |
+
// 32-bit Linux系统
|
97 |
+
adb push runtime/Linux/rknn_server/armhf/usr/bin/rknn_server /usr/bin/
|
98 |
+
```
|
99 |
+
2. 更新RKNPU runtime库
|
100 |
+
```
|
101 |
+
// 64-bit Linux系统
|
102 |
+
adb push runtime/Linux/librknn_api/aarch64/librknnrt.so /usr/lib
|
103 |
+
// 32-bit Linux系统
|
104 |
+
adb push runtime/Linux/librknn_api/armhf/librknnrt.so /usr/lib
|
105 |
+
```
|
106 |
+
3. 修改代理程序权限
|
107 |
+
```
|
108 |
+
adb shell chmod +x /usr/bin/rknn_server
|
109 |
+
```
|
110 |
+
4. 启动代理服务
|
111 |
+
```
|
112 |
+
adb shell "killall rknn_server"
|
113 |
+
adb shell "nohup /usr/bin/rknn_server >/dev/null"&
|
114 |
+
```
|
115 |
+
5. 检查代理服务是否启动成功:
|
116 |
+
```
|
117 |
+
adb shell ps -ef|grep rknn_server
|
118 |
+
```
|
119 |
+
查看是否有`rknn_server`的进程id,如果存在表示代理服务启动成功;否则请在板子上手动启动代理服务,方法如下:
|
120 |
+
adb shell命令**进入板子shell界面**后,执行下列命令启动代理服务
|
121 |
+
|
122 |
+
```
|
123 |
+
nohup /usr/bin/rknn_server > /dev/null&
|
124 |
+
```
|
125 |
+
|
126 |
+
### 4.3Linux平台(RV1103/RV1106/RV1103B)
|
127 |
+
RV1103/RV1106/RV1103B上使用的RKNPU Runtime库是librknnmrt.so,使用armhf-uclibc目录下的rknn_server,启动步骤如下:
|
128 |
+
1. 更新代理程序
|
129 |
+
```
|
130 |
+
adb push runtime/Linux/rknn_server/armhf-uclibc/usr/bin/rknn_server /oem/usr/bin
|
131 |
+
```
|
132 |
+
2. 更新RKNPU runtime库
|
133 |
+
```
|
134 |
+
adb push runtime/Linux/librknn_api/armhf-uclibc/librknnmrt.so /oem/usr/lib
|
135 |
+
```
|
136 |
+
3. 修改代理程序权限
|
137 |
+
```
|
138 |
+
adb shell chmod +x /oem/usr/bin/rknn_server
|
139 |
+
```
|
140 |
+
4. 启动代理服务
|
141 |
+
```
|
142 |
+
adb shell "killall rknn_server"
|
143 |
+
adb shell "nohup /oem/usr/bin/rknn_server >/dev/null"&
|
144 |
+
```
|
145 |
+
5. 检查代理服务是否启动成功:
|
146 |
+
```
|
147 |
+
adb shell ps |grep rknn_server
|
148 |
+
```
|
149 |
+
查看是否有`rknn_server`的进程id,如果存在表示代理服务启动成功;否则请在板子上手动启动代理服务,方法如下:
|
150 |
+
adb shell命令**进入板子shell界面**后,执行下列命令启动代理服务
|
151 |
+
|
152 |
+
```
|
153 |
+
nohup /oem/usr/bin/rknn_server > /dev/null&
|
154 |
+
```
|
155 |
+
|
156 |
+
## 5. 查看rknn_server详细日志
|
157 |
+
代理服务默认不开启详细日志,如遇到连板过程报错,需开启详细日志来定位错误原因,请参考相应平台执行步骤:
|
158 |
+
### 5.1 Android平台
|
159 |
+
1. 设置环境变量开启详细日志,并启动代理:
|
160 |
+
```
|
161 |
+
adb logcat -c
|
162 |
+
adb shell "killall rknn_server"
|
163 |
+
adb shell "setprop persist.vendor.rknn.server.log.level 5 && nohup /vendor/bin/rknn_server >/dev/null"&
|
164 |
+
```
|
165 |
+
2. 检查代理服务是否启动成功:
|
166 |
+
|
167 |
+
```
|
168 |
+
adb shell ps -ef|grep rknn_server
|
169 |
+
```
|
170 |
+
3. 运行PC上python推理程序
|
171 |
+
4. 查看运行日志
|
172 |
+
```
|
173 |
+
adb logcat
|
174 |
+
```
|
175 |
+
|
176 |
+
5. 开启详细日志会导致推理速度变慢,恢复默认日志等级的命令如下:
|
177 |
+
|
178 |
+
```sh
|
179 |
+
adb shell "killall rknn_server"
|
180 |
+
adb shell "setprop persist.vendor.rknn.server.log.level 0 && nohup /vendor/bin/rknn_server >/dev/null"&
|
181 |
+
```
|
182 |
+
|
183 |
+
### 5.2 Linux平台(非RV1103/RV1106/RV1103B)
|
184 |
+
|
185 |
+
1. 创建目录,用于保存代理服务的详细日志
|
186 |
+
```
|
187 |
+
adb shell mkdir -p /userdata
|
188 |
+
```
|
189 |
+
2. 设置环境变量开启详细日志,并启动代理:
|
190 |
+
```
|
191 |
+
adb shell "killall rknn_server"
|
192 |
+
adb shell "export RKNN_SERVER_LOGLEVEL=5 && nohup /usr/bin/rknn_server >/userdata/server.log"&
|
193 |
+
```
|
194 |
+
3. 检查代理服务是否启动成功:
|
195 |
+
```
|
196 |
+
adb shell ps -ef|grep rknn_server
|
197 |
+
```
|
198 |
+
查看是否有`rknn_server`的进程id,如果存在表示代理服务启动成功;否则请在板子上手动启动代理服务,方法如下:
|
199 |
+
adb shell命令进入板子shell界面后,执行下列命令启动代理服务
|
200 |
+
```
|
201 |
+
export RKNN_SERVER_LOGLEVEL=5
|
202 |
+
nohup /usr/bin/rknn_server >/userdata/server.log&
|
203 |
+
exit
|
204 |
+
```
|
205 |
+
4. 运行PC上python推理程序
|
206 |
+
5. 查看日志
|
207 |
+
```
|
208 |
+
adb shell cat /userdata/server.log
|
209 |
+
```
|
210 |
+
|
211 |
+
6. 开启详细日志会导致推理速度变慢,恢复默认日志等级的命令如下:
|
212 |
+
|
213 |
+
```sh
|
214 |
+
adb shell "killall rknn_server"
|
215 |
+
adb shell "export RKNN_SERVER_LOGLEVEL=0 && nohup /usr/bin/rknn_server >/userdata/server.log"&
|
216 |
+
```
|
217 |
+
|
218 |
+
### 5.3 Linux平台(RV1103/RV1106/RV1103B)
|
219 |
+
|
220 |
+
1. 创建目录,用于保存代理服务的详细日志
|
221 |
+
```
|
222 |
+
adb shell mkdir -p /userdata
|
223 |
+
```
|
224 |
+
2. 设置环境变量开启详细日志,并启动代理:
|
225 |
+
```
|
226 |
+
adb shell "killall rknn_server"
|
227 |
+
adb shell "export RKNN_SERVER_LOGLEVEL=5 && nohup /oem/usr/bin/rknn_server >/userdata/server.log"&
|
228 |
+
```
|
229 |
+
3. 检查代理服务是否启动成功:
|
230 |
+
```
|
231 |
+
adb shell ps|grep rknn_server
|
232 |
+
```
|
233 |
+
查看是否有`rknn_server`的进程id,如果存在表示代理服务启动成功;否则请在板子上手动启动代理服务,方法如下:
|
234 |
+
adb shell命令进入板子shell界面后,执行下列命令启动代理服务
|
235 |
+
```
|
236 |
+
export RKNN_SERVER_LOGLEVEL=5
|
237 |
+
nohup /oem/usr/bin/rknn_server >/userdata/server.log&
|
238 |
+
exit
|
239 |
+
```
|
240 |
+
4. 运行PC上python推理程序
|
241 |
+
5. 查看日志
|
242 |
+
```
|
243 |
+
adb shell cat /userdata/server.log
|
244 |
+
```
|
245 |
+
|
246 |
+
6. 开启详细日志会导致推理速度变慢,恢复默认日志等级的命令如下:
|
247 |
+
|
248 |
+
```sh
|
249 |
+
adb shell "killall rknn_server"
|
250 |
+
adb shell "export RKNN_SERVER_LOGLEVEL=0 && nohup /oem/usr/bin/rknn_server >/userdata/server.log"&
|
251 |
+
```
|
252 |
+
|
253 |
+
## 6. 常见问题
|
254 |
+
### 问题1
|
255 |
+
Debian系统上rknn_server服务已经后台启动, 但是连板推理时依旧有如下报错:
|
256 |
+
```
|
257 |
+
D NPUTransfer: ERROR: socket read fd = 4, n = -1: Connection reset by peer
|
258 |
+
D NPUTransfer: Transfer client closed, fd = 4
|
259 |
+
E RKNNAPI: rknn_init, server connect fail! ret = -9(ERROR_PIPE)!
|
260 |
+
E build_graph: The rknn_server on the concected device is abnormal, please start the rknn_server on the device according to:
|
261 |
+
https://github.com/airockchip/rknn-toolkit2/blob/master/doc/rknn_server_proxy.md
|
262 |
+
```
|
263 |
+
|
264 |
+
**解决方法:**
|
265 |
+
这通常是由于Debian固件上的adbd程序没有监听5037端口导致的,可以在板子上执行以下命令来判断:
|
266 |
+
```
|
267 |
+
netstat -n -t -u -a
|
268 |
+
```
|
269 |
+
如果输出结果中没有5037端口,则执行下列命令下载和更新adbd程序, 并重启板子;否则,跳过下列步骤。
|
270 |
+
```
|
271 |
+
wget -O adbd.zip https://ftzr.zbox.filez.com/v2/delivery/data/7f0ac30dfa474892841fcb2cd29ad924/adbd.zip
|
272 |
+
unzip adbd.zip
|
273 |
+
adb push adbd/linux-aarch64/adbd /usr/bin/adbd
|
274 |
+
```
|
275 |
+
进入设备shell命令,增加adbd的可执行权限
|
276 |
+
|
277 |
+
```sh
|
278 |
+
adb shell "chmod +x /usr/bin/adbd"
|
279 |
+
adb reboot
|
280 |
+
```
|
281 |
+
|
282 |
+
重启设备后,按照启动步骤启动rknn_server服务,再次尝试连板推理。
|
283 |
+
|
284 |
+
|
285 |
+
### 问题2
|
286 |
+
在RV1103/RV1106/RV1103B设备上遇到"E RKNN: failed to allocate fd, ret: -1, errno: 12"或者OOM报错。
|
287 |
+
**解决方法:**
|
288 |
+
在RV1103/RV1106/RV1103B设备上运行RkLunch-stop.sh,关闭其他占用内存的应用,并将rknn_server升级到>=2.1.0版本后再连板推理。
|
289 |
+
|
290 |
+
### 问题3
|
291 |
+
RV1103/RV1106/RV1103B使用init_runtime python接口时,没有逐层的耗时。
|
292 |
+
原因:RV1103/RV1106/RV1103B上**不支持**perf_debug=True参数。
|
293 |
+
|
294 |
+
### 问题4
|
295 |
+
RV1103/RV1106/RV1103B使用accuracy_analysis python接口使用时,因为模型太大,板子上存储容量不够导致运行失败。
|
296 |
+
|
297 |
+
**解决方法:**
|
298 |
+
|
299 |
+
在设备端df -h查看存储空间情况,假设设备存储情况如下:
|
300 |
+
|
301 |
+
```sh
|
302 |
+
Filesystem Size Used Available Use% Mounted on
|
303 |
+
ubi0:rootfs 17.0M 14.1M 2.9M 83% /
|
304 |
+
devtmpfs 27.4M 0 27.4M 0% /dev
|
305 |
+
tmpfs 27.5M 0 27.5M 0% /dev/shm
|
306 |
+
tmpfs 27.5M 8.0K 27.5M 0% /tmp
|
307 |
+
tmpfs 27.5M 84.0K 27.4M 0% /run
|
308 |
+
/dev/ubi5_0 20.6M 14.5M 6.1M 70% /oem
|
309 |
+
/dev/ubi6_0 52.8M 24.5M 28.2M 46% /userdata
|
310 |
+
|
311 |
+
```
|
312 |
+
|
313 |
+
从上面看出/userdata/目录的可用空间最大,故将/userdata/目录作为精度分析时保存中间结果文件的目录,再重启rknn_server,PC上执行命令如下:
|
314 |
+
|
315 |
+
```
|
316 |
+
adb shell "killall rknn_server"
|
317 |
+
adb shell "export RKNN_DUMP_DIR=/userdata/dumps && nohup /usr/bin/rknn_server >/dev/null"&
|
318 |
+
```
|
319 |
+
|
320 |
+
RV1103/RV1106/RV1103B的rknn_server默认的保存中间结果路径是/tmp/dumps,如果需要恢复默认路径,请执行下列命令:
|
321 |
+
|
322 |
+
```adb shell "killall rknn_server"
|
323 |
+
adb shell "killall rknn_server"
|
324 |
+
adb shell "unset RKNN_DUMP_DIR && nohup /usr/bin/rknn_server >/dev/null"&
|
325 |
+
```
|
326 |
+
|
327 |
+
如果设备存储空间不足,并且RV1103/RV1106/RV1103B固件支持NFS挂载,则可以将dump目录挂载到NFS目录后,再执行精度分析。假设目标服务器的IP为192.168.1.1,服务器NFS目录是/data0/nfs_shared,则在设备上执行下列命令将/userdata/dumps挂载到NFS目录
|
328 |
+
|
329 |
+
```
|
330 |
+
# 以241为例
|
331 |
+
mkdir -p /userdata/dumps
|
332 |
+
mount -t nfs -o nolock 192.168.1.1:/data0/nfs_shared /userdata/dumps
|
333 |
+
```
|
334 |
+
|
335 |
+
### 问题5
|
336 |
+
|
337 |
+
使用adb命令更新Runtime库后没有生效。
|
338 |
+
|
339 |
+
**解决方法**:
|
340 |
+
|
341 |
+
更新库后要重新启动rknn_server,下次连板推理才能生效。如果是RV1103/RV1106/RV1103B平台,确保将librknnmrt.so放在/oem/usr/lib目录,如果/usr/lib/目录下有同名的库,要删除/usr/lib/下的librknnmrt.so,并重启rknn_server。
|
342 |
+
|
343 |
+
### 问题6
|
344 |
+
|
345 |
+
Android系统启动代理服务遇到权限问题。
|
346 |
+
|
347 |
+
**解决方法**:
|
348 |
+
|
349 |
+
使用adb shell setenforce 0命令来关闭selinux。
|
res/QQGroup2QRCode.png
ADDED
![]() |
Git LFS Details
|
res/QQGroup3QRCode.png
ADDED
![]() |
Git LFS Details
|
res/QQGroupQRCode.png
ADDED
![]() |
Git LFS Details
|
res/framework.png
ADDED
![]() |
Git LFS Details
|
res/logo.png
ADDED
![]() |
Git LFS Details
|
rknn-toolkit-lite2/CHANGELOG.txt
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
2024-08-08
|
2 |
+
版本: v2.1.0
|
3 |
+
1. 修复已知BUG。
|
4 |
+
|
5 |
+
2024-03-14
|
6 |
+
版本: v2.0.0b0
|
7 |
+
1. 功能完善:
|
8 |
+
1.1 新增对RK3576的支持;
|
9 |
+
1.2 init_runtime core_mask参数增加新的可选值:RKNNLite.NPU_CORE_ALL。
|
10 |
+
|
11 |
+
2023-12-04
|
12 |
+
版本: v1.6.0
|
13 |
+
1. 功能完善:
|
14 |
+
1.1 新增适配AARCH64 Python3.11的安装包;
|
15 |
+
1.2 推理接口增加对动态shape模型的支持;
|
16 |
+
1.3 推理接口增加对4维NCHW格式输入的支持。
|
17 |
+
|
18 |
+
2023-08-21
|
19 |
+
版本: v1.5.2
|
20 |
+
1. 更新版本号
|
21 |
+
|
22 |
+
版本: v1.5.0
|
23 |
+
1. 功能完善:
|
24 |
+
1.1 新增对RK3562的支持;
|
25 |
+
1.2 新增适配AARCH64 Python3.8, Python3.10的安装包;
|
26 |
+
1.3 适配1.5.0版本NPU驱动。
|
27 |
+
|
28 |
+
2022-08-31
|
29 |
+
版本: v1.4.0
|
30 |
+
1. 功能完善:
|
31 |
+
1.1 init_runtime core_mask支持NPU_CORE_0_1和NPU_CORE_0_1_2;
|
32 |
+
1.2 适配1.4.0版本NPU驱动。
|
33 |
+
|
34 |
+
2022-04-27
|
35 |
+
版本: v1.3.0
|
36 |
+
1. 功能完善:
|
37 |
+
1.1 完善init_runtime失败的提示信息;
|
38 |
+
1.2 适配1.3.0版本NPU驱动。
|
39 |
+
|
40 |
+
2022-01-14
|
41 |
+
版本:v1.2.0
|
42 |
+
1. 新功能:
|
43 |
+
1.1 RKNN模型推理;
|
44 |
+
1.2 SDK版本查询;
|
45 |
+
1.3 模型可运行平台查询。
|
rknn-toolkit-lite2/examples/dynamic_shape/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# How to use dynamic shape function
|
2 |
+
|
3 |
+
## Model Source
|
4 |
+
The model used in this example come from the following open source projects:
|
5 |
+
https://github.com/shicai/MobileNet-Caffe
|
6 |
+
|
7 |
+
### Convert to RKNN model
|
8 |
+
Please refer to the example in the RKNN Toolkit2 project to generate the RKNN model:
|
9 |
+
https://github.com/rockchip-linux/rknn-toolkit2/tree/master/examples/functions/dynamic_shape
|
10 |
+
|
11 |
+
## Script Usage
|
12 |
+
*Usage:*
|
13 |
+
```
|
14 |
+
python test.py
|
15 |
+
```
|
16 |
+
|
17 |
+
## Expected Results
|
18 |
+
This example will print the TOP5 labels and corresponding scores of the test image classification results for each different input shape, as follows:
|
19 |
+
```
|
20 |
+
model: mobilenet_v2
|
21 |
+
|
22 |
+
input shape: 1,3,224,224
|
23 |
+
W The input[0] need NHWC data format, but NCHW set, the data format and data buffer will be changed to NHWC.
|
24 |
+
-----TOP 5-----
|
25 |
+
[155] score:0.992188 class:"Shih-Tzu"
|
26 |
+
[154] score:0.002636 class:"Pekinese, Pekingese, Peke"
|
27 |
+
[204] score:0.002636 class:"Lhasa, Lhasa apso"
|
28 |
+
[283] score:0.001698 class:"Persian cat"
|
29 |
+
[896] score:0.000273 class:"washbasin, handbasin, washbowl, lavabo, wash-hand basin"
|
30 |
+
|
31 |
+
input shape: 1,3,160,160
|
32 |
+
W The input[0] need NHWC data format, but NCHW set, the data format and data buffer will be changed to NHWC.
|
33 |
+
-----TOP 5-----
|
34 |
+
[155] score:0.558594 class:"Shih-Tzu"
|
35 |
+
[154] score:0.408447 class:"Pekinese, Pekingese, Peke"
|
36 |
+
[204] score:0.031036 class:"Lhasa, Lhasa apso"
|
37 |
+
[194] score:0.000956 class:"Dandie Dinmont, Dandie Dinmont terrier"
|
38 |
+
[219] score:0.000256 class:"cocker spaniel, English cocker spaniel, cocker"
|
39 |
+
|
40 |
+
input shape: 1,3,256,256
|
41 |
+
W The input[0] need NHWC data format, but NCHW set, the data format and data buffer will be changed to NHWC.
|
42 |
+
-----TOP 5-----
|
43 |
+
[155] score:0.980957 class:"Shih-Tzu"
|
44 |
+
[154] score:0.008835 class:"Pekinese, Pekingese, Peke"
|
45 |
+
[204] score:0.004883 class:"Lhasa, Lhasa apso"
|
46 |
+
[193] score:0.000929 class:"Australian terrier"
|
47 |
+
[200] score:0.000509 class:"Tibetan terrier, chrysanthemum dog"
|
48 |
+
```
|
49 |
+
- Note: Different platforms, different versions of tools and drivers may have slightly different results.
|
rknn-toolkit-lite2/examples/dynamic_shape/dog_224x224.jpg
ADDED
![]() |
Git LFS Details
|
rknn-toolkit-lite2/examples/dynamic_shape/mobilenet_v2_for_rk3562.rknn
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f71efa3af9e664e79a3508663f02038e3fdc081cb3f3e4f2be646f6588b622bb
|
3 |
+
size 4955210
|
rknn-toolkit-lite2/examples/dynamic_shape/mobilenet_v2_for_rk3566_rk3568.rknn
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f591b57b93f76226aed9741ecc4910bb7d69c88fe397fdeaedd57fa0f1904373
|
3 |
+
size 4623050
|
rknn-toolkit-lite2/examples/dynamic_shape/mobilenet_v2_for_rk3576.rknn
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e659fee1c0f0e2a9d22fe9e6dc85ea29c6a2dca8a222995c0838a3ece5e9ad49
|
3 |
+
size 6006922
|
rknn-toolkit-lite2/examples/dynamic_shape/mobilenet_v2_for_rk3588.rknn
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b866cf43678a7bec1df7b002d222f369f9a63d5197e0c1eaa9d0a407b1deb433
|
3 |
+
size 5856394
|
rknn-toolkit-lite2/examples/dynamic_shape/synset_label.py
ADDED
@@ -0,0 +1,1003 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# the labels come from synset.txt, download link: https://s3.amazonaws.com/onnx-model-zoo/synset.txt
|
2 |
+
|
3 |
+
labels = \
|
4 |
+
{0: 'tench, Tinca tinca',
|
5 |
+
1: 'goldfish, Carassius auratus',
|
6 |
+
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
|
7 |
+
3: 'tiger shark, Galeocerdo cuvieri',
|
8 |
+
4: 'hammerhead, hammerhead shark',
|
9 |
+
5: 'electric ray, crampfish, numbfish, torpedo',
|
10 |
+
6: 'stingray',
|
11 |
+
7: 'cock',
|
12 |
+
8: 'hen',
|
13 |
+
9: 'ostrich, Struthio camelus',
|
14 |
+
10: 'brambling, Fringilla montifringilla',
|
15 |
+
11: 'goldfinch, Carduelis carduelis',
|
16 |
+
12: 'house finch, linnet, Carpodacus mexicanus',
|
17 |
+
13: 'junco, snowbird',
|
18 |
+
14: 'indigo bunting, indigo finch, indigo bird, Passerina cyanea',
|
19 |
+
15: 'robin, American robin, Turdus migratorius',
|
20 |
+
16: 'bulbul',
|
21 |
+
17: 'jay',
|
22 |
+
18: 'magpie',
|
23 |
+
19: 'chickadee',
|
24 |
+
20: 'water ouzel, dipper',
|
25 |
+
21: 'kite',
|
26 |
+
22: 'bald eagle, American eagle, Haliaeetus leucocephalus',
|
27 |
+
23: 'vulture',
|
28 |
+
24: 'great grey owl, great gray owl, Strix nebulosa',
|
29 |
+
25: 'European fire salamander, Salamandra salamandra',
|
30 |
+
26: 'common newt, Triturus vulgaris',
|
31 |
+
27: 'eft',
|
32 |
+
28: 'spotted salamander, Ambystoma maculatum',
|
33 |
+
29: 'axolotl, mud puppy, Ambystoma mexicanum',
|
34 |
+
30: 'bullfrog, Rana catesbeiana',
|
35 |
+
31: 'tree frog, tree-frog',
|
36 |
+
32: 'tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui',
|
37 |
+
33: 'loggerhead, loggerhead turtle, Caretta caretta',
|
38 |
+
34: 'leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea',
|
39 |
+
35: 'mud turtle',
|
40 |
+
36: 'terrapin',
|
41 |
+
37: 'box turtle, box tortoise',
|
42 |
+
38: 'banded gecko',
|
43 |
+
39: 'common iguana, iguana, Iguana iguana',
|
44 |
+
40: 'American chameleon, anole, Anolis carolinensis',
|
45 |
+
41: 'whiptail, whiptail lizard',
|
46 |
+
42: 'agama',
|
47 |
+
43: 'frilled lizard, Chlamydosaurus kingi',
|
48 |
+
44: 'alligator lizard',
|
49 |
+
45: 'Gila monster, Heloderma suspectum',
|
50 |
+
46: 'green lizard, Lacerta viridis',
|
51 |
+
47: 'African chameleon, Chamaeleo chamaeleon',
|
52 |
+
48: 'Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis',
|
53 |
+
49: 'African crocodile, Nile crocodile, Crocodylus niloticus',
|
54 |
+
50: 'American alligator, Alligator mississipiensis',
|
55 |
+
51: 'triceratops',
|
56 |
+
52: 'thunder snake, worm snake, Carphophis amoenus',
|
57 |
+
53: 'ringneck snake, ring-necked snake, ring snake',
|
58 |
+
54: 'hognose snake, puff adder, sand viper',
|
59 |
+
55: 'green snake, grass snake',
|
60 |
+
56: 'king snake, kingsnake',
|
61 |
+
57: 'garter snake, grass snake',
|
62 |
+
58: 'water snake',
|
63 |
+
59: 'vine snake',
|
64 |
+
60: 'night snake, Hypsiglena torquata',
|
65 |
+
61: 'boa constrictor, Constrictor constrictor',
|
66 |
+
62: 'rock python, rock snake, Python sebae',
|
67 |
+
63: 'Indian cobra, Naja naja',
|
68 |
+
64: 'green mamba',
|
69 |
+
65: 'sea snake',
|
70 |
+
66: 'horned viper, cerastes, sand viper, horned asp, Cerastes cornutus',
|
71 |
+
67: 'diamondback, diamondback rattlesnake, Crotalus adamanteus',
|
72 |
+
68: 'sidewinder, horned rattlesnake, Crotalus cerastes',
|
73 |
+
69: 'trilobite',
|
74 |
+
70: 'harvestman, daddy longlegs, Phalangium opilio',
|
75 |
+
71: 'scorpion',
|
76 |
+
72: 'black and gold garden spider, Argiope aurantia',
|
77 |
+
73: 'barn spider, Araneus cavaticus',
|
78 |
+
74: 'garden spider, Aranea diademata',
|
79 |
+
75: 'black widow, Latrodectus mactans',
|
80 |
+
76: 'tarantula',
|
81 |
+
77: 'wolf spider, hunting spider',
|
82 |
+
78: 'tick',
|
83 |
+
79: 'centipede',
|
84 |
+
80: 'black grouse',
|
85 |
+
81: 'ptarmigan',
|
86 |
+
82: 'ruffed grouse, partridge, Bonasa umbellus',
|
87 |
+
83: 'prairie chicken, prairie grouse, prairie fowl',
|
88 |
+
84: 'peacock',
|
89 |
+
85: 'quail',
|
90 |
+
86: 'partridge',
|
91 |
+
87: 'African grey, African gray, Psittacus erithacus',
|
92 |
+
88: 'macaw',
|
93 |
+
89: 'sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita',
|
94 |
+
90: 'lorikeet',
|
95 |
+
91: 'coucal',
|
96 |
+
92: 'bee eater',
|
97 |
+
93: 'hornbill',
|
98 |
+
94: 'hummingbird',
|
99 |
+
95: 'jacamar',
|
100 |
+
96: 'toucan',
|
101 |
+
97: 'drake',
|
102 |
+
98: 'red-breasted merganser, Mergus serrator',
|
103 |
+
99: 'goose',
|
104 |
+
100: 'black swan, Cygnus atratus',
|
105 |
+
101: 'tusker',
|
106 |
+
102: 'echidna, spiny anteater, anteater',
|
107 |
+
103: 'platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus',
|
108 |
+
104: 'wallaby, brush kangaroo',
|
109 |
+
105: 'koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus',
|
110 |
+
106: 'wombat',
|
111 |
+
107: 'jellyfish',
|
112 |
+
108: 'sea anemone, anemone',
|
113 |
+
109: 'brain coral',
|
114 |
+
110: 'flatworm, platyhelminth',
|
115 |
+
111: 'nematode, nematode worm, roundworm',
|
116 |
+
112: 'conch',
|
117 |
+
113: 'snail',
|
118 |
+
114: 'slug',
|
119 |
+
115: 'sea slug, nudibranch',
|
120 |
+
116: 'chiton, coat-of-mail shell, sea cradle, polyplacophore',
|
121 |
+
117: 'chambered nautilus, pearly nautilus, nautilus',
|
122 |
+
118: 'Dungeness crab, Cancer magister',
|
123 |
+
119: 'rock crab, Cancer irroratus',
|
124 |
+
120: 'fiddler crab',
|
125 |
+
121: 'king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica',
|
126 |
+
122: 'American lobster, Northern lobster, Maine lobster, Homarus americanus',
|
127 |
+
123: 'spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish',
|
128 |
+
124: 'crayfish, crawfish, crawdad, crawdaddy',
|
129 |
+
125: 'hermit crab',
|
130 |
+
126: 'isopod',
|
131 |
+
127: 'white stork, Ciconia ciconia',
|
132 |
+
128: 'black stork, Ciconia nigra',
|
133 |
+
129: 'spoonbill',
|
134 |
+
130: 'flamingo',
|
135 |
+
131: 'little blue heron, Egretta caerulea',
|
136 |
+
132: 'American egret, great white heron, Egretta albus',
|
137 |
+
133: 'bittern',
|
138 |
+
134: 'crane',
|
139 |
+
135: 'limpkin, Aramus pictus',
|
140 |
+
136: 'European gallinule, Porphyrio porphyrio',
|
141 |
+
137: 'American coot, marsh hen, mud hen, water hen, Fulica americana',
|
142 |
+
138: 'bustard',
|
143 |
+
139: 'ruddy turnstone, Arenaria interpres',
|
144 |
+
140: 'red-backed sandpiper, dunlin, Erolia alpina',
|
145 |
+
141: 'redshank, Tringa totanus',
|
146 |
+
142: 'dowitcher',
|
147 |
+
143: 'oystercatcher, oyster catcher',
|
148 |
+
144: 'pelican',
|
149 |
+
145: 'king penguin, Aptenodytes patagonica',
|
150 |
+
146: 'albatross, mollymawk',
|
151 |
+
147: 'grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus',
|
152 |
+
148: 'killer whale, killer, orca, grampus, sea wolf, Orcinus orca',
|
153 |
+
149: 'dugong, Dugong dugon',
|
154 |
+
150: 'sea lion',
|
155 |
+
151: 'Chihuahua',
|
156 |
+
152: 'Japanese spaniel',
|
157 |
+
153: 'Maltese dog, Maltese terrier, Maltese',
|
158 |
+
154: 'Pekinese, Pekingese, Peke',
|
159 |
+
155: 'Shih-Tzu',
|
160 |
+
156: 'Blenheim spaniel',
|
161 |
+
157: 'papillon',
|
162 |
+
158: 'toy terrier',
|
163 |
+
159: 'Rhodesian ridgeback',
|
164 |
+
160: 'Afghan hound, Afghan',
|
165 |
+
161: 'basset, basset hound',
|
166 |
+
162: 'beagle',
|
167 |
+
163: 'bloodhound, sleuthhound',
|
168 |
+
164: 'bluetick',
|
169 |
+
165: 'black-and-tan coonhound',
|
170 |
+
166: 'Walker hound, Walker foxhound',
|
171 |
+
167: 'English foxhound',
|
172 |
+
168: 'redbone',
|
173 |
+
169: 'borzoi, Russian wolfhound',
|
174 |
+
170: 'Irish wolfhound',
|
175 |
+
171: 'Italian greyhound',
|
176 |
+
172: 'whippet',
|
177 |
+
173: 'Ibizan hound, Ibizan Podenco',
|
178 |
+
174: 'Norwegian elkhound, elkhound',
|
179 |
+
175: 'otterhound, otter hound',
|
180 |
+
176: 'Saluki, gazelle hound',
|
181 |
+
177: 'Scottish deerhound, deerhound',
|
182 |
+
178: 'Weimaraner',
|
183 |
+
179: 'Staffordshire bullterrier, Staffordshire bull terrier',
|
184 |
+
180: 'American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier',
|
185 |
+
181: 'Bedlington terrier',
|
186 |
+
182: 'Border terrier',
|
187 |
+
183: 'Kerry blue terrier',
|
188 |
+
184: 'Irish terrier',
|
189 |
+
185: 'Norfolk terrier',
|
190 |
+
186: 'Norwich terrier',
|
191 |
+
187: 'Yorkshire terrier',
|
192 |
+
188: 'wire-haired fox terrier',
|
193 |
+
189: 'Lakeland terrier',
|
194 |
+
190: 'Sealyham terrier, Sealyham',
|
195 |
+
191: 'Airedale, Airedale terrier',
|
196 |
+
192: 'cairn, cairn terrier',
|
197 |
+
193: 'Australian terrier',
|
198 |
+
194: 'Dandie Dinmont, Dandie Dinmont terrier',
|
199 |
+
195: 'Boston bull, Boston terrier',
|
200 |
+
196: 'miniature schnauzer',
|
201 |
+
197: 'giant schnauzer',
|
202 |
+
198: 'standard schnauzer',
|
203 |
+
199: 'Scotch terrier, Scottish terrier, Scottie',
|
204 |
+
200: 'Tibetan terrier, chrysanthemum dog',
|
205 |
+
201: 'silky terrier, Sydney silky',
|
206 |
+
202: 'soft-coated wheaten terrier',
|
207 |
+
203: 'West Highland white terrier',
|
208 |
+
204: 'Lhasa, Lhasa apso',
|
209 |
+
205: 'flat-coated retriever',
|
210 |
+
206: 'curly-coated retriever',
|
211 |
+
207: 'golden retriever',
|
212 |
+
208: 'Labrador retriever',
|
213 |
+
209: 'Chesapeake Bay retriever',
|
214 |
+
210: 'German short-haired pointer',
|
215 |
+
211: 'vizsla, Hungarian pointer',
|
216 |
+
212: 'English setter',
|
217 |
+
213: 'Irish setter, red setter',
|
218 |
+
214: 'Gordon setter',
|
219 |
+
215: 'Brittany spaniel',
|
220 |
+
216: 'clumber, clumber spaniel',
|
221 |
+
217: 'English springer, English springer spaniel',
|
222 |
+
218: 'Welsh springer spaniel',
|
223 |
+
219: 'cocker spaniel, English cocker spaniel, cocker',
|
224 |
+
220: 'Sussex spaniel',
|
225 |
+
221: 'Irish water spaniel',
|
226 |
+
222: 'kuvasz',
|
227 |
+
223: 'schipperke',
|
228 |
+
224: 'groenendael',
|
229 |
+
225: 'malinois',
|
230 |
+
226: 'briard',
|
231 |
+
227: 'kelpie',
|
232 |
+
228: 'komondor',
|
233 |
+
229: 'Old English sheepdog, bobtail',
|
234 |
+
230: 'Shetland sheepdog, Shetland sheep dog, Shetland',
|
235 |
+
231: 'collie',
|
236 |
+
232: 'Border collie',
|
237 |
+
233: 'Bouvier des Flandres, Bouviers des Flandres',
|
238 |
+
234: 'Rottweiler',
|
239 |
+
235: 'German shepherd, German shepherd dog, German police dog, alsatian',
|
240 |
+
236: 'Doberman, Doberman pinscher',
|
241 |
+
237: 'miniature pinscher',
|
242 |
+
238: 'Greater Swiss Mountain dog',
|
243 |
+
239: 'Bernese mountain dog',
|
244 |
+
240: 'Appenzeller',
|
245 |
+
241: 'EntleBucher',
|
246 |
+
242: 'boxer',
|
247 |
+
243: 'bull mastiff',
|
248 |
+
244: 'Tibetan mastiff',
|
249 |
+
245: 'French bulldog',
|
250 |
+
246: 'Great Dane',
|
251 |
+
247: 'Saint Bernard, St Bernard',
|
252 |
+
248: 'Eskimo dog, husky',
|
253 |
+
249: 'malamute, malemute, Alaskan malamute',
|
254 |
+
250: 'Siberian husky',
|
255 |
+
251: 'dalmatian, coach dog, carriage dog',
|
256 |
+
252: 'affenpinscher, monkey pinscher, monkey dog',
|
257 |
+
253: 'basenji',
|
258 |
+
254: 'pug, pug-dog',
|
259 |
+
255: 'Leonberg',
|
260 |
+
256: 'Newfoundland, Newfoundland dog',
|
261 |
+
257: 'Great Pyrenees',
|
262 |
+
258: 'Samoyed, Samoyede',
|
263 |
+
259: 'Pomeranian',
|
264 |
+
260: 'chow, chow chow',
|
265 |
+
261: 'keeshond',
|
266 |
+
262: 'Brabancon griffon',
|
267 |
+
263: 'Pembroke, Pembroke Welsh corgi',
|
268 |
+
264: 'Cardigan, Cardigan Welsh corgi',
|
269 |
+
265: 'toy poodle',
|
270 |
+
266: 'miniature poodle',
|
271 |
+
267: 'standard poodle',
|
272 |
+
268: 'Mexican hairless',
|
273 |
+
269: 'timber wolf, grey wolf, gray wolf, Canis lupus',
|
274 |
+
270: 'white wolf, Arctic wolf, Canis lupus tundrarum',
|
275 |
+
271: 'red wolf, maned wolf, Canis rufus, Canis niger',
|
276 |
+
272: 'coyote, prairie wolf, brush wolf, Canis latrans',
|
277 |
+
273: 'dingo, warrigal, warragal, Canis dingo',
|
278 |
+
274: 'dhole, Cuon alpinus',
|
279 |
+
275: 'African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus',
|
280 |
+
276: 'hyena, hyaena',
|
281 |
+
277: 'red fox, Vulpes vulpes',
|
282 |
+
278: 'kit fox, Vulpes macrotis',
|
283 |
+
279: 'Arctic fox, white fox, Alopex lagopus',
|
284 |
+
280: 'grey fox, gray fox, Urocyon cinereoargenteus',
|
285 |
+
281: 'tabby, tabby cat',
|
286 |
+
282: 'tiger cat',
|
287 |
+
283: 'Persian cat',
|
288 |
+
284: 'Siamese cat, Siamese',
|
289 |
+
285: 'Egyptian cat',
|
290 |
+
286: 'cougar, puma, catamount, mountain lion, painter, panther, Felis concolor',
|
291 |
+
287: 'lynx, catamount',
|
292 |
+
288: 'leopard, Panthera pardus',
|
293 |
+
289: 'snow leopard, ounce, Panthera uncia',
|
294 |
+
290: 'jaguar, panther, Panthera onca, Felis onca',
|
295 |
+
291: 'lion, king of beasts, Panthera leo',
|
296 |
+
292: 'tiger, Panthera tigris',
|
297 |
+
293: 'cheetah, chetah, Acinonyx jubatus',
|
298 |
+
294: 'brown bear, bruin, Ursus arctos',
|
299 |
+
295: 'American black bear, black bear, Ursus americanus, Euarctos americanus',
|
300 |
+
296: 'ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus',
|
301 |
+
297: 'sloth bear, Melursus ursinus, Ursus ursinus',
|
302 |
+
298: 'mongoose',
|
303 |
+
299: 'meerkat, mierkat',
|
304 |
+
300: 'tiger beetle',
|
305 |
+
301: 'ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle',
|
306 |
+
302: 'ground beetle, carabid beetle',
|
307 |
+
303: 'long-horned beetle, longicorn, longicorn beetle',
|
308 |
+
304: 'leaf beetle, chrysomelid',
|
309 |
+
305: 'dung beetle',
|
310 |
+
306: 'rhinoceros beetle',
|
311 |
+
307: 'weevil',
|
312 |
+
308: 'fly',
|
313 |
+
309: 'bee',
|
314 |
+
310: 'ant, emmet, pismire',
|
315 |
+
311: 'grasshopper, hopper',
|
316 |
+
312: 'cricket',
|
317 |
+
313: 'walking stick, walkingstick, stick insect',
|
318 |
+
314: 'cockroach, roach',
|
319 |
+
315: 'mantis, mantid',
|
320 |
+
316: 'cicada, cicala',
|
321 |
+
317: 'leafhopper',
|
322 |
+
318: 'lacewing, lacewing fly',
|
323 |
+
319: "dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk",
|
324 |
+
320: 'damselfly',
|
325 |
+
321: 'admiral',
|
326 |
+
322: 'ringlet, ringlet butterfly',
|
327 |
+
323: 'monarch, monarch butterfly, milkweed butterfly, Danaus plexippus',
|
328 |
+
324: 'cabbage butterfly',
|
329 |
+
325: 'sulphur butterfly, sulfur butterfly',
|
330 |
+
326: 'lycaenid, lycaenid butterfly',
|
331 |
+
327: 'starfish, sea star',
|
332 |
+
328: 'sea urchin',
|
333 |
+
329: 'sea cucumber, holothurian',
|
334 |
+
330: 'wood rabbit, cottontail, cottontail rabbit',
|
335 |
+
331: 'hare',
|
336 |
+
332: 'Angora, Angora rabbit',
|
337 |
+
333: 'hamster',
|
338 |
+
334: 'porcupine, hedgehog',
|
339 |
+
335: 'fox squirrel, eastern fox squirrel, Sciurus niger',
|
340 |
+
336: 'marmot',
|
341 |
+
337: 'beaver',
|
342 |
+
338: 'guinea pig, Cavia cobaya',
|
343 |
+
339: 'sorrel',
|
344 |
+
340: 'zebra',
|
345 |
+
341: 'hog, pig, grunter, squealer, Sus scrofa',
|
346 |
+
342: 'wild boar, boar, Sus scrofa',
|
347 |
+
343: 'warthog',
|
348 |
+
344: 'hippopotamus, hippo, river horse, Hippopotamus amphibius',
|
349 |
+
345: 'ox',
|
350 |
+
346: 'water buffalo, water ox, Asiatic buffalo, Bubalus bubalis',
|
351 |
+
347: 'bison',
|
352 |
+
348: 'ram, tup',
|
353 |
+
349: 'bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis',
|
354 |
+
350: 'ibex, Capra ibex',
|
355 |
+
351: 'hartebeest',
|
356 |
+
352: 'impala, Aepyceros melampus',
|
357 |
+
353: 'gazelle',
|
358 |
+
354: 'Arabian camel, dromedary, Camelus dromedarius',
|
359 |
+
355: 'llama',
|
360 |
+
356: 'weasel',
|
361 |
+
357: 'mink',
|
362 |
+
358: 'polecat, fitch, foulmart, foumart, Mustela putorius',
|
363 |
+
359: 'black-footed ferret, ferret, Mustela nigripes',
|
364 |
+
360: 'otter',
|
365 |
+
361: 'skunk, polecat, wood pussy',
|
366 |
+
362: 'badger',
|
367 |
+
363: 'armadillo',
|
368 |
+
364: 'three-toed sloth, ai, Bradypus tridactylus',
|
369 |
+
365: 'orangutan, orang, orangutang, Pongo pygmaeus',
|
370 |
+
366: 'gorilla, Gorilla gorilla',
|
371 |
+
367: 'chimpanzee, chimp, Pan troglodytes',
|
372 |
+
368: 'gibbon, Hylobates lar',
|
373 |
+
369: 'siamang, Hylobates syndactylus, Symphalangus syndactylus',
|
374 |
+
370: 'guenon, guenon monkey',
|
375 |
+
371: 'patas, hussar monkey, Erythrocebus patas',
|
376 |
+
372: 'baboon',
|
377 |
+
373: 'macaque',
|
378 |
+
374: 'langur',
|
379 |
+
375: 'colobus, colobus monkey',
|
380 |
+
376: 'proboscis monkey, Nasalis larvatus',
|
381 |
+
377: 'marmoset',
|
382 |
+
378: 'capuchin, ringtail, Cebus capucinus',
|
383 |
+
379: 'howler monkey, howler',
|
384 |
+
380: 'titi, titi monkey',
|
385 |
+
381: 'spider monkey, Ateles geoffroyi',
|
386 |
+
382: 'squirrel monkey, Saimiri sciureus',
|
387 |
+
383: 'Madagascar cat, ring-tailed lemur, Lemur catta',
|
388 |
+
384: 'indri, indris, Indri indri, Indri brevicaudatus',
|
389 |
+
385: 'Indian elephant, Elephas maximus',
|
390 |
+
386: 'African elephant, Loxodonta africana',
|
391 |
+
387: 'lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens',
|
392 |
+
388: 'giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca',
|
393 |
+
389: 'barracouta, snoek',
|
394 |
+
390: 'eel',
|
395 |
+
391: 'coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch',
|
396 |
+
392: 'rock beauty, Holocanthus tricolor',
|
397 |
+
393: 'anemone fish',
|
398 |
+
394: 'sturgeon',
|
399 |
+
395: 'gar, garfish, garpike, billfish, Lepisosteus osseus',
|
400 |
+
396: 'lionfish',
|
401 |
+
397: 'puffer, pufferfish, blowfish, globefish',
|
402 |
+
398: 'abacus',
|
403 |
+
399: 'abaya',
|
404 |
+
400: "academic gown, academic robe, judge's robe",
|
405 |
+
401: 'accordion, piano accordion, squeeze box',
|
406 |
+
402: 'acoustic guitar',
|
407 |
+
403: 'aircraft carrier, carrier, flattop, attack aircraft carrier',
|
408 |
+
404: 'airliner',
|
409 |
+
405: 'airship, dirigible',
|
410 |
+
406: 'altar',
|
411 |
+
407: 'ambulance',
|
412 |
+
408: 'amphibian, amphibious vehicle',
|
413 |
+
409: 'analog clock',
|
414 |
+
410: 'apiary, bee house',
|
415 |
+
411: 'apron',
|
416 |
+
412: 'ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin',
|
417 |
+
413: 'assault rifle, assault gun',
|
418 |
+
414: 'backpack, back pack, knapsack, packsack, rucksack, haversack',
|
419 |
+
415: 'bakery, bakeshop, bakehouse',
|
420 |
+
416: 'balance beam, beam',
|
421 |
+
417: 'balloon',
|
422 |
+
418: 'ballpoint, ballpoint pen, ballpen, Biro',
|
423 |
+
419: 'Band Aid',
|
424 |
+
420: 'banjo',
|
425 |
+
421: 'bannister, banister, balustrade, balusters, handrail',
|
426 |
+
422: 'barbell',
|
427 |
+
423: 'barber chair',
|
428 |
+
424: 'barbershop',
|
429 |
+
425: 'barn',
|
430 |
+
426: 'barometer',
|
431 |
+
427: 'barrel, cask',
|
432 |
+
428: 'barrow, garden cart, lawn cart, wheelbarrow',
|
433 |
+
429: 'baseball',
|
434 |
+
430: 'basketball',
|
435 |
+
431: 'bassinet',
|
436 |
+
432: 'bassoon',
|
437 |
+
433: 'bathing cap, swimming cap',
|
438 |
+
434: 'bath towel',
|
439 |
+
435: 'bathtub, bathing tub, bath, tub',
|
440 |
+
436: 'beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon',
|
441 |
+
437: 'beacon, lighthouse, beacon light, pharos',
|
442 |
+
438: 'beaker',
|
443 |
+
439: 'bearskin, busby, shako',
|
444 |
+
440: 'beer bottle',
|
445 |
+
441: 'beer glass',
|
446 |
+
442: 'bell cote, bell cot',
|
447 |
+
443: 'bib',
|
448 |
+
444: 'bicycle-built-for-two, tandem bicycle, tandem',
|
449 |
+
445: 'bikini, two-piece',
|
450 |
+
446: 'binder, ring-binder',
|
451 |
+
447: 'binoculars, field glasses, opera glasses',
|
452 |
+
448: 'birdhouse',
|
453 |
+
449: 'boathouse',
|
454 |
+
450: 'bobsled, bobsleigh, bob',
|
455 |
+
451: 'bolo tie, bolo, bola tie, bola',
|
456 |
+
452: 'bonnet, poke bonnet',
|
457 |
+
453: 'bookcase',
|
458 |
+
454: 'bookshop, bookstore, bookstall',
|
459 |
+
455: 'bottlecap',
|
460 |
+
456: 'bow',
|
461 |
+
457: 'bow tie, bow-tie, bowtie',
|
462 |
+
458: 'brass, memorial tablet, plaque',
|
463 |
+
459: 'brassiere, bra, bandeau',
|
464 |
+
460: 'breakwater, groin, groyne, mole, bulwark, seawall, jetty',
|
465 |
+
461: 'breastplate, aegis, egis',
|
466 |
+
462: 'broom',
|
467 |
+
463: 'bucket, pail',
|
468 |
+
464: 'buckle',
|
469 |
+
465: 'bulletproof vest',
|
470 |
+
466: 'bullet train, bullet',
|
471 |
+
467: 'butcher shop, meat market',
|
472 |
+
468: 'cab, hack, taxi, taxicab',
|
473 |
+
469: 'caldron, cauldron',
|
474 |
+
470: 'candle, taper, wax light',
|
475 |
+
471: 'cannon',
|
476 |
+
472: 'canoe',
|
477 |
+
473: 'can opener, tin opener',
|
478 |
+
474: 'cardigan',
|
479 |
+
475: 'car mirror',
|
480 |
+
476: 'carousel, carrousel, merry-go-round, roundabout, whirligig',
|
481 |
+
477: "carpenter's kit, tool kit",
|
482 |
+
478: 'carton',
|
483 |
+
479: 'car wheel',
|
484 |
+
480: 'cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM',
|
485 |
+
481: 'cassette',
|
486 |
+
482: 'cassette player',
|
487 |
+
483: 'castle',
|
488 |
+
484: 'catamaran',
|
489 |
+
485: 'CD player',
|
490 |
+
486: 'cello, violoncello',
|
491 |
+
487: 'cellular telephone, cellular phone, cellphone, cell, mobile phone',
|
492 |
+
488: 'chain',
|
493 |
+
489: 'chainlink fence',
|
494 |
+
490: 'chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour',
|
495 |
+
491: 'chain saw, chainsaw',
|
496 |
+
492: 'chest',
|
497 |
+
493: 'chiffonier, commode',
|
498 |
+
494: 'chime, bell, gong',
|
499 |
+
495: 'china cabinet, china closet',
|
500 |
+
496: 'Christmas stocking',
|
501 |
+
497: 'church, church building',
|
502 |
+
498: 'cinema, movie theater, movie theatre, movie house, picture palace',
|
503 |
+
499: 'cleaver, meat cleaver, chopper',
|
504 |
+
500: 'cliff dwelling',
|
505 |
+
501: 'cloak',
|
506 |
+
502: 'clog, geta, patten, sabot',
|
507 |
+
503: 'cocktail shaker',
|
508 |
+
504: 'coffee mug',
|
509 |
+
505: 'coffeepot',
|
510 |
+
506: 'coil, spiral, volute, whorl, helix',
|
511 |
+
507: 'combination lock',
|
512 |
+
508: 'computer keyboard, keypad',
|
513 |
+
509: 'confectionery, confectionary, candy store',
|
514 |
+
510: 'container ship, containership, container vessel',
|
515 |
+
511: 'convertible',
|
516 |
+
512: 'corkscrew, bottle screw',
|
517 |
+
513: 'cornet, horn, trumpet, trump',
|
518 |
+
514: 'cowboy boot',
|
519 |
+
515: 'cowboy hat, ten-gallon hat',
|
520 |
+
516: 'cradle',
|
521 |
+
517: 'crane',
|
522 |
+
518: 'crash helmet',
|
523 |
+
519: 'crate',
|
524 |
+
520: 'crib, cot',
|
525 |
+
521: 'Crock Pot',
|
526 |
+
522: 'croquet ball',
|
527 |
+
523: 'crutch',
|
528 |
+
524: 'cuirass',
|
529 |
+
525: 'dam, dike, dyke',
|
530 |
+
526: 'desk',
|
531 |
+
527: 'desktop computer',
|
532 |
+
528: 'dial telephone, dial phone',
|
533 |
+
529: 'diaper, nappy, napkin',
|
534 |
+
530: 'digital clock',
|
535 |
+
531: 'digital watch',
|
536 |
+
532: 'dining table, board',
|
537 |
+
533: 'dishrag, dishcloth',
|
538 |
+
534: 'dishwasher, dish washer, dishwashing machine',
|
539 |
+
535: 'disk brake, disc brake',
|
540 |
+
536: 'dock, dockage, docking facility',
|
541 |
+
537: 'dogsled, dog sled, dog sleigh',
|
542 |
+
538: 'dome',
|
543 |
+
539: 'doormat, welcome mat',
|
544 |
+
540: 'drilling platform, offshore rig',
|
545 |
+
541: 'drum, membranophone, tympan',
|
546 |
+
542: 'drumstick',
|
547 |
+
543: 'dumbbell',
|
548 |
+
544: 'Dutch oven',
|
549 |
+
545: 'electric fan, blower',
|
550 |
+
546: 'electric guitar',
|
551 |
+
547: 'electric locomotive',
|
552 |
+
548: 'entertainment center',
|
553 |
+
549: 'envelope',
|
554 |
+
550: 'espresso maker',
|
555 |
+
551: 'face powder',
|
556 |
+
552: 'feather boa, boa',
|
557 |
+
553: 'file, file cabinet, filing cabinet',
|
558 |
+
554: 'fireboat',
|
559 |
+
555: 'fire engine, fire truck',
|
560 |
+
556: 'fire screen, fireguard',
|
561 |
+
557: 'flagpole, flagstaff',
|
562 |
+
558: 'flute, transverse flute',
|
563 |
+
559: 'folding chair',
|
564 |
+
560: 'football helmet',
|
565 |
+
561: 'forklift',
|
566 |
+
562: 'fountain',
|
567 |
+
563: 'fountain pen',
|
568 |
+
564: 'four-poster',
|
569 |
+
565: 'freight car',
|
570 |
+
566: 'French horn, horn',
|
571 |
+
567: 'frying pan, frypan, skillet',
|
572 |
+
568: 'fur coat',
|
573 |
+
569: 'garbage truck, dustcart',
|
574 |
+
570: 'gasmask, respirator, gas helmet',
|
575 |
+
571: 'gas pump, gasoline pump, petrol pump, island dispenser',
|
576 |
+
572: 'goblet',
|
577 |
+
573: 'go-kart',
|
578 |
+
574: 'golf ball',
|
579 |
+
575: 'golfcart, golf cart',
|
580 |
+
576: 'gondola',
|
581 |
+
577: 'gong, tam-tam',
|
582 |
+
578: 'gown',
|
583 |
+
579: 'grand piano, grand',
|
584 |
+
580: 'greenhouse, nursery, glasshouse',
|
585 |
+
581: 'grille, radiator grille',
|
586 |
+
582: 'grocery store, grocery, food market, market',
|
587 |
+
583: 'guillotine',
|
588 |
+
584: 'hair slide',
|
589 |
+
585: 'hair spray',
|
590 |
+
586: 'half track',
|
591 |
+
587: 'hammer',
|
592 |
+
588: 'hamper',
|
593 |
+
589: 'hand blower, blow dryer, blow drier, hair dryer, hair drier',
|
594 |
+
590: 'hand-held computer, hand-held microcomputer',
|
595 |
+
591: 'handkerchief, hankie, hanky, hankey',
|
596 |
+
592: 'hard disc, hard disk, fixed disk',
|
597 |
+
593: 'harmonica, mouth organ, harp, mouth harp',
|
598 |
+
594: 'harp',
|
599 |
+
595: 'harvester, reaper',
|
600 |
+
596: 'hatchet',
|
601 |
+
597: 'holster',
|
602 |
+
598: 'home theater, home theatre',
|
603 |
+
599: 'honeycomb',
|
604 |
+
600: 'hook, claw',
|
605 |
+
601: 'hoopskirt, crinoline',
|
606 |
+
602: 'horizontal bar, high bar',
|
607 |
+
603: 'horse cart, horse-cart',
|
608 |
+
604: 'hourglass',
|
609 |
+
605: 'iPod',
|
610 |
+
606: 'iron, smoothing iron',
|
611 |
+
607: "jack-o'-lantern",
|
612 |
+
608: 'jean, blue jean, denim',
|
613 |
+
609: 'jeep, landrover',
|
614 |
+
610: 'jersey, T-shirt, tee shirt',
|
615 |
+
611: 'jigsaw puzzle',
|
616 |
+
612: 'jinrikisha, ricksha, rickshaw',
|
617 |
+
613: 'joystick',
|
618 |
+
614: 'kimono',
|
619 |
+
615: 'knee pad',
|
620 |
+
616: 'knot',
|
621 |
+
617: 'lab coat, laboratory coat',
|
622 |
+
618: 'ladle',
|
623 |
+
619: 'lampshade, lamp shade',
|
624 |
+
620: 'laptop, laptop computer',
|
625 |
+
621: 'lawn mower, mower',
|
626 |
+
622: 'lens cap, lens cover',
|
627 |
+
623: 'letter opener, paper knife, paperknife',
|
628 |
+
624: 'library',
|
629 |
+
625: 'lifeboat',
|
630 |
+
626: 'lighter, light, igniter, ignitor',
|
631 |
+
627: 'limousine, limo',
|
632 |
+
628: 'liner, ocean liner',
|
633 |
+
629: 'lipstick, lip rouge',
|
634 |
+
630: 'Loafer',
|
635 |
+
631: 'lotion',
|
636 |
+
632: 'loudspeaker, speaker, speaker unit, loudspeaker system, speaker system',
|
637 |
+
633: "loupe, jeweler's loupe",
|
638 |
+
634: 'lumbermill, sawmill',
|
639 |
+
635: 'magnetic compass',
|
640 |
+
636: 'mailbag, postbag',
|
641 |
+
637: 'mailbox, letter box',
|
642 |
+
638: 'maillot',
|
643 |
+
639: 'maillot, tank suit',
|
644 |
+
640: 'manhole cover',
|
645 |
+
641: 'maraca',
|
646 |
+
642: 'marimba, xylophone',
|
647 |
+
643: 'mask',
|
648 |
+
644: 'matchstick',
|
649 |
+
645: 'maypole',
|
650 |
+
646: 'maze, labyrinth',
|
651 |
+
647: 'measuring cup',
|
652 |
+
648: 'medicine chest, medicine cabinet',
|
653 |
+
649: 'megalith, megalithic structure',
|
654 |
+
650: 'microphone, mike',
|
655 |
+
651: 'microwave, microwave oven',
|
656 |
+
652: 'military uniform',
|
657 |
+
653: 'milk can',
|
658 |
+
654: 'minibus',
|
659 |
+
655: 'miniskirt, mini',
|
660 |
+
656: 'minivan',
|
661 |
+
657: 'missile',
|
662 |
+
658: 'mitten',
|
663 |
+
659: 'mixing bowl',
|
664 |
+
660: 'mobile home, manufactured home',
|
665 |
+
661: 'Model T',
|
666 |
+
662: 'modem',
|
667 |
+
663: 'monastery',
|
668 |
+
664: 'monitor',
|
669 |
+
665: 'moped',
|
670 |
+
666: 'mortar',
|
671 |
+
667: 'mortarboard',
|
672 |
+
668: 'mosque',
|
673 |
+
669: 'mosquito net',
|
674 |
+
670: 'motor scooter, scooter',
|
675 |
+
671: 'mountain bike, all-terrain bike, off-roader',
|
676 |
+
672: 'mountain tent',
|
677 |
+
673: 'mouse, computer mouse',
|
678 |
+
674: 'mousetrap',
|
679 |
+
675: 'moving van',
|
680 |
+
676: 'muzzle',
|
681 |
+
677: 'nail',
|
682 |
+
678: 'neck brace',
|
683 |
+
679: 'necklace',
|
684 |
+
680: 'nipple',
|
685 |
+
681: 'notebook, notebook computer',
|
686 |
+
682: 'obelisk',
|
687 |
+
683: 'oboe, hautboy, hautbois',
|
688 |
+
684: 'ocarina, sweet potato',
|
689 |
+
685: 'odometer, hodometer, mileometer, milometer',
|
690 |
+
686: 'oil filter',
|
691 |
+
687: 'organ, pipe organ',
|
692 |
+
688: 'oscilloscope, scope, cathode-ray oscilloscope, CRO',
|
693 |
+
689: 'overskirt',
|
694 |
+
690: 'oxcart',
|
695 |
+
691: 'oxygen mask',
|
696 |
+
692: 'packet',
|
697 |
+
693: 'paddle, boat paddle',
|
698 |
+
694: 'paddlewheel, paddle wheel',
|
699 |
+
695: 'padlock',
|
700 |
+
696: 'paintbrush',
|
701 |
+
697: "pajama, pyjama, pj's, jammies",
|
702 |
+
698: 'palace',
|
703 |
+
699: 'panpipe, pandean pipe, syrinx',
|
704 |
+
700: 'paper towel',
|
705 |
+
701: 'parachute, chute',
|
706 |
+
702: 'parallel bars, bars',
|
707 |
+
703: 'park bench',
|
708 |
+
704: 'parking meter',
|
709 |
+
705: 'passenger car, coach, carriage',
|
710 |
+
706: 'patio, terrace',
|
711 |
+
707: 'pay-phone, pay-station',
|
712 |
+
708: 'pedestal, plinth, footstall',
|
713 |
+
709: 'pencil box, pencil case',
|
714 |
+
710: 'pencil sharpener',
|
715 |
+
711: 'perfume, essence',
|
716 |
+
712: 'Petri dish',
|
717 |
+
713: 'photocopier',
|
718 |
+
714: 'pick, plectrum, plectron',
|
719 |
+
715: 'pickelhaube',
|
720 |
+
716: 'picket fence, paling',
|
721 |
+
717: 'pickup, pickup truck',
|
722 |
+
718: 'pier',
|
723 |
+
719: 'piggy bank, penny bank',
|
724 |
+
720: 'pill bottle',
|
725 |
+
721: 'pillow',
|
726 |
+
722: 'ping-pong ball',
|
727 |
+
723: 'pinwheel',
|
728 |
+
724: 'pirate, pirate ship',
|
729 |
+
725: 'pitcher, ewer',
|
730 |
+
726: "plane, carpenter's plane, woodworking plane",
|
731 |
+
727: 'planetarium',
|
732 |
+
728: 'plastic bag',
|
733 |
+
729: 'plate rack',
|
734 |
+
730: 'plow, plough',
|
735 |
+
731: "plunger, plumber's helper",
|
736 |
+
732: 'Polaroid camera, Polaroid Land camera',
|
737 |
+
733: 'pole',
|
738 |
+
734: 'police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria',
|
739 |
+
735: 'poncho',
|
740 |
+
736: 'pool table, billiard table, snooker table',
|
741 |
+
737: 'pop bottle, soda bottle',
|
742 |
+
738: 'pot, flowerpot',
|
743 |
+
739: "potter's wheel",
|
744 |
+
740: 'power drill',
|
745 |
+
741: 'prayer rug, prayer mat',
|
746 |
+
742: 'printer',
|
747 |
+
743: 'prison, prison house',
|
748 |
+
744: 'projectile, missile',
|
749 |
+
745: 'projector',
|
750 |
+
746: 'puck, hockey puck',
|
751 |
+
747: 'punching bag, punch bag, punching ball, punchball',
|
752 |
+
748: 'purse',
|
753 |
+
749: 'quill, quill pen',
|
754 |
+
750: 'quilt, comforter, comfort, puff',
|
755 |
+
751: 'racer, race car, racing car',
|
756 |
+
752: 'racket, racquet',
|
757 |
+
753: 'radiator',
|
758 |
+
754: 'radio, wireless',
|
759 |
+
755: 'radio telescope, radio reflector',
|
760 |
+
756: 'rain barrel',
|
761 |
+
757: 'recreational vehicle, RV, R.V.',
|
762 |
+
758: 'reel',
|
763 |
+
759: 'reflex camera',
|
764 |
+
760: 'refrigerator, icebox',
|
765 |
+
761: 'remote control, remote',
|
766 |
+
762: 'restaurant, eating house, eating place, eatery',
|
767 |
+
763: 'revolver, six-gun, six-shooter',
|
768 |
+
764: 'rifle',
|
769 |
+
765: 'rocking chair, rocker',
|
770 |
+
766: 'rotisserie',
|
771 |
+
767: 'rubber eraser, rubber, pencil eraser',
|
772 |
+
768: 'rugby ball',
|
773 |
+
769: 'rule, ruler',
|
774 |
+
770: 'running shoe',
|
775 |
+
771: 'safe',
|
776 |
+
772: 'safety pin',
|
777 |
+
773: 'saltshaker, salt shaker',
|
778 |
+
774: 'sandal',
|
779 |
+
775: 'sarong',
|
780 |
+
776: 'sax, saxophone',
|
781 |
+
777: 'scabbard',
|
782 |
+
778: 'scale, weighing machine',
|
783 |
+
779: 'school bus',
|
784 |
+
780: 'schooner',
|
785 |
+
781: 'scoreboard',
|
786 |
+
782: 'screen, CRT screen',
|
787 |
+
783: 'screw',
|
788 |
+
784: 'screwdriver',
|
789 |
+
785: 'seat belt, seatbelt',
|
790 |
+
786: 'sewing machine',
|
791 |
+
787: 'shield, buckler',
|
792 |
+
788: 'shoe shop, shoe-shop, shoe store',
|
793 |
+
789: 'shoji',
|
794 |
+
790: 'shopping basket',
|
795 |
+
791: 'shopping cart',
|
796 |
+
792: 'shovel',
|
797 |
+
793: 'shower cap',
|
798 |
+
794: 'shower curtain',
|
799 |
+
795: 'ski',
|
800 |
+
796: 'ski mask',
|
801 |
+
797: 'sleeping bag',
|
802 |
+
798: 'slide rule, slipstick',
|
803 |
+
799: 'sliding door',
|
804 |
+
800: 'slot, one-armed bandit',
|
805 |
+
801: 'snorkel',
|
806 |
+
802: 'snowmobile',
|
807 |
+
803: 'snowplow, snowplough',
|
808 |
+
804: 'soap dispenser',
|
809 |
+
805: 'soccer ball',
|
810 |
+
806: 'sock',
|
811 |
+
807: 'solar dish, solar collector, solar furnace',
|
812 |
+
808: 'sombrero',
|
813 |
+
809: 'soup bowl',
|
814 |
+
810: 'space bar',
|
815 |
+
811: 'space heater',
|
816 |
+
812: 'space shuttle',
|
817 |
+
813: 'spatula',
|
818 |
+
814: 'speedboat',
|
819 |
+
815: "spider web, spider's web",
|
820 |
+
816: 'spindle',
|
821 |
+
817: 'sports car, sport car',
|
822 |
+
818: 'spotlight, spot',
|
823 |
+
819: 'stage',
|
824 |
+
820: 'steam locomotive',
|
825 |
+
821: 'steel arch bridge',
|
826 |
+
822: 'steel drum',
|
827 |
+
823: 'stethoscope',
|
828 |
+
824: 'stole',
|
829 |
+
825: 'stone wall',
|
830 |
+
826: 'stopwatch, stop watch',
|
831 |
+
827: 'stove',
|
832 |
+
828: 'strainer',
|
833 |
+
829: 'streetcar, tram, tramcar, trolley, trolley car',
|
834 |
+
830: 'stretcher',
|
835 |
+
831: 'studio couch, day bed',
|
836 |
+
832: 'stupa, tope',
|
837 |
+
833: 'submarine, pigboat, sub, U-boat',
|
838 |
+
834: 'suit, suit of clothes',
|
839 |
+
835: 'sundial',
|
840 |
+
836: 'sunglass',
|
841 |
+
837: 'sunglasses, dark glasses, shades',
|
842 |
+
838: 'sunscreen, sunblock, sun blocker',
|
843 |
+
839: 'suspension bridge',
|
844 |
+
840: 'swab, swob, mop',
|
845 |
+
841: 'sweatshirt',
|
846 |
+
842: 'swimming trunks, bathing trunks',
|
847 |
+
843: 'swing',
|
848 |
+
844: 'switch, electric switch, electrical switch',
|
849 |
+
845: 'syringe',
|
850 |
+
846: 'table lamp',
|
851 |
+
847: 'tank, army tank, armored combat vehicle, armoured combat vehicle',
|
852 |
+
848: 'tape player',
|
853 |
+
849: 'teapot',
|
854 |
+
850: 'teddy, teddy bear',
|
855 |
+
851: 'television, television system',
|
856 |
+
852: 'tennis ball',
|
857 |
+
853: 'thatch, thatched roof',
|
858 |
+
854: 'theater curtain, theatre curtain',
|
859 |
+
855: 'thimble',
|
860 |
+
856: 'thresher, thrasher, threshing machine',
|
861 |
+
857: 'throne',
|
862 |
+
858: 'tile roof',
|
863 |
+
859: 'toaster',
|
864 |
+
860: 'tobacco shop, tobacconist shop, tobacconist',
|
865 |
+
861: 'toilet seat',
|
866 |
+
862: 'torch',
|
867 |
+
863: 'totem pole',
|
868 |
+
864: 'tow truck, tow car, wrecker',
|
869 |
+
865: 'toyshop',
|
870 |
+
866: 'tractor',
|
871 |
+
867: 'trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi',
|
872 |
+
868: 'tray',
|
873 |
+
869: 'trench coat',
|
874 |
+
870: 'tricycle, trike, velocipede',
|
875 |
+
871: 'trimaran',
|
876 |
+
872: 'tripod',
|
877 |
+
873: 'triumphal arch',
|
878 |
+
874: 'trolleybus, trolley coach, trackless trolley',
|
879 |
+
875: 'trombone',
|
880 |
+
876: 'tub, vat',
|
881 |
+
877: 'turnstile',
|
882 |
+
878: 'typewriter keyboard',
|
883 |
+
879: 'umbrella',
|
884 |
+
880: 'unicycle, monocycle',
|
885 |
+
881: 'upright, upright piano',
|
886 |
+
882: 'vacuum, vacuum cleaner',
|
887 |
+
883: 'vase',
|
888 |
+
884: 'vault',
|
889 |
+
885: 'velvet',
|
890 |
+
886: 'vending machine',
|
891 |
+
887: 'vestment',
|
892 |
+
888: 'viaduct',
|
893 |
+
889: 'violin, fiddle',
|
894 |
+
890: 'volleyball',
|
895 |
+
891: 'waffle iron',
|
896 |
+
892: 'wall clock',
|
897 |
+
893: 'wallet, billfold, notecase, pocketbook',
|
898 |
+
894: 'wardrobe, closet, press',
|
899 |
+
895: 'warplane, military plane',
|
900 |
+
896: 'washbasin, handbasin, washbowl, lavabo, wash-hand basin',
|
901 |
+
897: 'washer, automatic washer, washing machine',
|
902 |
+
898: 'water bottle',
|
903 |
+
899: 'water jug',
|
904 |
+
900: 'water tower',
|
905 |
+
901: 'whiskey jug',
|
906 |
+
902: 'whistle',
|
907 |
+
903: 'wig',
|
908 |
+
904: 'window screen',
|
909 |
+
905: 'window shade',
|
910 |
+
906: 'Windsor tie',
|
911 |
+
907: 'wine bottle',
|
912 |
+
908: 'wing',
|
913 |
+
909: 'wok',
|
914 |
+
910: 'wooden spoon',
|
915 |
+
911: 'wool, woolen, woollen',
|
916 |
+
912: 'worm fence, snake fence, snake-rail fence, Virginia fence',
|
917 |
+
913: 'wreck',
|
918 |
+
914: 'yawl',
|
919 |
+
915: 'yurt',
|
920 |
+
916: 'web site, website, internet site, site',
|
921 |
+
917: 'comic book',
|
922 |
+
918: 'crossword puzzle, crossword',
|
923 |
+
919: 'street sign',
|
924 |
+
920: 'traffic light, traffic signal, stoplight',
|
925 |
+
921: 'book jacket, dust cover, dust jacket, dust wrapper',
|
926 |
+
922: 'menu',
|
927 |
+
923: 'plate',
|
928 |
+
924: 'guacamole',
|
929 |
+
925: 'consomme',
|
930 |
+
926: 'hot pot, hotpot',
|
931 |
+
927: 'trifle',
|
932 |
+
928: 'ice cream, icecream',
|
933 |
+
929: 'ice lolly, lolly, lollipop, popsicle',
|
934 |
+
930: 'French loaf',
|
935 |
+
931: 'bagel, beigel',
|
936 |
+
932: 'pretzel',
|
937 |
+
933: 'cheeseburger',
|
938 |
+
934: 'hotdog, hot dog, red hot',
|
939 |
+
935: 'mashed potato',
|
940 |
+
936: 'head cabbage',
|
941 |
+
937: 'broccoli',
|
942 |
+
938: 'cauliflower',
|
943 |
+
939: 'zucchini, courgette',
|
944 |
+
940: 'spaghetti squash',
|
945 |
+
941: 'acorn squash',
|
946 |
+
942: 'butternut squash',
|
947 |
+
943: 'cucumber, cuke',
|
948 |
+
944: 'artichoke, globe artichoke',
|
949 |
+
945: 'bell pepper',
|
950 |
+
946: 'cardoon',
|
951 |
+
947: 'mushroom',
|
952 |
+
948: 'Granny Smith',
|
953 |
+
949: 'strawberry',
|
954 |
+
950: 'orange',
|
955 |
+
951: 'lemon',
|
956 |
+
952: 'fig',
|
957 |
+
953: 'pineapple, ananas',
|
958 |
+
954: 'banana',
|
959 |
+
955: 'jackfruit, jak, jack',
|
960 |
+
956: 'custard apple',
|
961 |
+
957: 'pomegranate',
|
962 |
+
958: 'hay',
|
963 |
+
959: 'carbonara',
|
964 |
+
960: 'chocolate sauce, chocolate syrup',
|
965 |
+
961: 'dough',
|
966 |
+
962: 'meat loaf, meatloaf',
|
967 |
+
963: 'pizza, pizza pie',
|
968 |
+
964: 'potpie',
|
969 |
+
965: 'burrito',
|
970 |
+
966: 'red wine',
|
971 |
+
967: 'espresso',
|
972 |
+
968: 'cup',
|
973 |
+
969: 'eggnog',
|
974 |
+
970: 'alp',
|
975 |
+
971: 'bubble',
|
976 |
+
972: 'cliff, drop, drop-off',
|
977 |
+
973: 'coral reef',
|
978 |
+
974: 'geyser',
|
979 |
+
975: 'lakeside, lakeshore',
|
980 |
+
976: 'promontory, headland, head, foreland',
|
981 |
+
977: 'sandbar, sand bar',
|
982 |
+
978: 'seashore, coast, seacoast, sea-coast',
|
983 |
+
979: 'valley, vale',
|
984 |
+
980: 'volcano',
|
985 |
+
981: 'ballplayer, baseball player',
|
986 |
+
982: 'groom, bridegroom',
|
987 |
+
983: 'scuba diver',
|
988 |
+
984: 'rapeseed',
|
989 |
+
985: 'daisy',
|
990 |
+
986: "yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum",
|
991 |
+
987: 'corn',
|
992 |
+
988: 'acorn',
|
993 |
+
989: 'hip, rose hip, rosehip',
|
994 |
+
990: 'buckeye, horse chestnut, conker',
|
995 |
+
991: 'coral fungus',
|
996 |
+
992: 'agaric',
|
997 |
+
993: 'gyromitra',
|
998 |
+
994: 'stinkhorn, carrion fungus',
|
999 |
+
995: 'earthstar',
|
1000 |
+
996: 'hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa',
|
1001 |
+
997: 'bolete',
|
1002 |
+
998: 'ear, spike, capitulum',
|
1003 |
+
999: 'toilet tissue, toilet paper, bathroom tissue'}
|
rknn-toolkit-lite2/examples/dynamic_shape/test.py
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import cv2
|
2 |
+
import numpy as np
|
3 |
+
import platform
|
4 |
+
from synset_label import labels
|
5 |
+
from rknnlite.api import RKNNLite
|
6 |
+
|
7 |
+
# decice tree for RK356x/RK3576/RK3588
|
8 |
+
DEVICE_COMPATIBLE_NODE = '/proc/device-tree/compatible'
|
9 |
+
|
10 |
+
def get_host():
|
11 |
+
# get platform and device type
|
12 |
+
system = platform.system()
|
13 |
+
machine = platform.machine()
|
14 |
+
os_machine = system + '-' + machine
|
15 |
+
if os_machine == 'Linux-aarch64':
|
16 |
+
try:
|
17 |
+
with open(DEVICE_COMPATIBLE_NODE) as f:
|
18 |
+
device_compatible_str = f.read()
|
19 |
+
if 'rk3588' in device_compatible_str:
|
20 |
+
host = 'RK3588'
|
21 |
+
elif 'rk3562' in device_compatible_str:
|
22 |
+
host = 'RK3562'
|
23 |
+
elif 'rk3576' in device_compatible_str:
|
24 |
+
host = 'RK3576'
|
25 |
+
else:
|
26 |
+
host = 'RK3566_RK3568'
|
27 |
+
except IOError:
|
28 |
+
print('Read device node {} failed.'.format(DEVICE_COMPATIBLE_NODE))
|
29 |
+
exit(-1)
|
30 |
+
else:
|
31 |
+
host = os_machine
|
32 |
+
return host
|
33 |
+
|
34 |
+
INPUT_SIZE = 224
|
35 |
+
|
36 |
+
RK3566_RK3568_RKNN_MODEL = 'mobilenet_v2_for_rk3566_rk3568.rknn'
|
37 |
+
RK3588_RKNN_MODEL = 'mobilenet_v2_for_rk3588.rknn'
|
38 |
+
RK3562_RKNN_MODEL = 'mobilenet_v2_for_rk3562.rknn'
|
39 |
+
RK3576_RKNN_MODEL = 'mobilenet_v2_for_rk3576.rknn'
|
40 |
+
|
41 |
+
|
42 |
+
def show_top5(result):
|
43 |
+
output = result[0].reshape(-1)
|
44 |
+
# Get the indices of the top 5 largest values
|
45 |
+
output_sorted_indices = np.argsort(output)[::-1][:5]
|
46 |
+
top5_str = '-----TOP 5-----\n'
|
47 |
+
for i, index in enumerate(output_sorted_indices):
|
48 |
+
value = output[index]
|
49 |
+
if value > 0:
|
50 |
+
topi = '[{:>3d}] score:{:.6f} class:"{}"\n'.format(
|
51 |
+
index, value, labels[index])
|
52 |
+
else:
|
53 |
+
topi = '-1: 0.0\n'
|
54 |
+
top5_str += topi
|
55 |
+
print(top5_str)
|
56 |
+
|
57 |
+
|
58 |
+
if __name__ == '__main__':
|
59 |
+
|
60 |
+
# Get device information
|
61 |
+
host_name = get_host()
|
62 |
+
if host_name == 'RK3566_RK3568':
|
63 |
+
rknn_model = RK3566_RK3568_RKNN_MODEL
|
64 |
+
elif host_name == 'RK3562':
|
65 |
+
rknn_model = RK3562_RKNN_MODEL
|
66 |
+
elif host_name == 'RK3576':
|
67 |
+
rknn_model = RK3576_RKNN_MODEL
|
68 |
+
elif host_name == 'RK3588':
|
69 |
+
rknn_model = RK3588_RKNN_MODEL
|
70 |
+
else:
|
71 |
+
print("This demo cannot run on the current platform: {}".format(host_name))
|
72 |
+
exit(-1)
|
73 |
+
|
74 |
+
dynamic_input = [
|
75 |
+
[[1, 3, 192, 192]],
|
76 |
+
[[1, 3, 256, 256]],
|
77 |
+
[[1, 3, 160, 160]],
|
78 |
+
[[1, 3, 224, 224]]
|
79 |
+
]
|
80 |
+
|
81 |
+
rknn_lite = RKNNLite()
|
82 |
+
|
83 |
+
# Load RKNN model
|
84 |
+
print('--> Load RKNN model')
|
85 |
+
ret = rknn_lite.load_rknn(rknn_model)
|
86 |
+
if ret != 0:
|
87 |
+
print('Load RKNN model failed')
|
88 |
+
exit(ret)
|
89 |
+
print('done')
|
90 |
+
|
91 |
+
img = cv2.imread('./dog_224x224.jpg')
|
92 |
+
|
93 |
+
# Init runtime environment
|
94 |
+
print('--> Init runtime environment')
|
95 |
+
# Run on RK356x / RK3576 / RK3588 with Debian OS, do not need specify target.
|
96 |
+
if host_name in ['RK3576', 'RK3588']:
|
97 |
+
# For RK3576 / RK3588, specify which NPU core the model runs on through the core_mask parameter.
|
98 |
+
ret = rknn_lite.init_runtime(core_mask=RKNNLite.NPU_CORE_0)
|
99 |
+
else:
|
100 |
+
ret = rknn_lite.init_runtime()
|
101 |
+
if ret != 0:
|
102 |
+
print('Init runtime environment failed')
|
103 |
+
exit(ret)
|
104 |
+
print('done')
|
105 |
+
|
106 |
+
# Inference
|
107 |
+
print('--> Running model')
|
108 |
+
print('model: mobilenet_v2\n')
|
109 |
+
print('input shape: 1,3,224,224')
|
110 |
+
real_img = cv2.resize(img, (224, 224))
|
111 |
+
real_img = np.expand_dims(real_img, 0)
|
112 |
+
real_img = np.transpose(real_img, (0, 3, 1, 2))
|
113 |
+
outputs = rknn_lite.inference(inputs=[real_img], data_format=['nchw'])
|
114 |
+
# Show the classification results
|
115 |
+
show_top5(outputs)
|
116 |
+
|
117 |
+
print('input shape: 1,3,160,160')
|
118 |
+
real_img = cv2.resize(img, (160, 160))
|
119 |
+
real_img = np.expand_dims(real_img, 0)
|
120 |
+
real_img = np.transpose(real_img, (0, 3, 1, 2))
|
121 |
+
outputs = rknn_lite.inference(inputs=[real_img], data_format=['nchw'])
|
122 |
+
# Show the classification results
|
123 |
+
show_top5(outputs)
|
124 |
+
|
125 |
+
print('input shape: 1,3,256,256')
|
126 |
+
real_img = cv2.resize(img, (256, 256))
|
127 |
+
real_img = np.expand_dims(real_img, 0)
|
128 |
+
real_img = np.transpose(real_img, (0, 3, 1, 2))
|
129 |
+
outputs = rknn_lite.inference(inputs=[real_img], data_format=['nchw'])
|
130 |
+
# Show the classification results
|
131 |
+
show_top5(outputs)
|
132 |
+
|
133 |
+
print('done')
|
134 |
+
|
135 |
+
rknn_lite.release()
|
rknn-toolkit-lite2/examples/resnet18/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Example of resnet18
|
2 |
+
|
3 |
+
## Model Source
|
4 |
+
|
5 |
+
### Original model
|
6 |
+
The models used in this example come from the torchvision project:
|
7 |
+
https://github.com/pytorch/vision/tree/main/torchvision/models
|
8 |
+
|
9 |
+
### Convert to RKNN model
|
10 |
+
Please refer to the example in the RKNN Toolkit2 project to generate the RKNN model:
|
11 |
+
https://github.com/rockchip-linux/rknn-toolkit2/tree/master/examples/pytorch/resnet18
|
12 |
+
|
13 |
+
## Script Usage
|
14 |
+
|
15 |
+
Usage
|
16 |
+
|
17 |
+
```
|
18 |
+
python test.py
|
19 |
+
```
|
20 |
+
|
21 |
+
## Expected results
|
22 |
+
|
23 |
+
This example will print the TOP5 labels and corresponding scores of the test image classification results. For example, the inference results of this example are as follows:
|
24 |
+
```
|
25 |
+
-----TOP 5-----
|
26 |
+
[812] score:0.999680 class:"space shuttle"
|
27 |
+
[404] score:0.000249 class:"airliner"
|
28 |
+
[657] score:0.000013 class:"missile"
|
29 |
+
[466] score:0.000009 class:"bullet train, bullet"
|
30 |
+
[895] score:0.000008 class:"warplane, military plane"
|
31 |
+
```
|
32 |
+
|
33 |
+
1. The label index with the highest score is 812, the corresponding label is `space shuttle`.
|
34 |
+
2. Different platforms, different versions of tools and drivers may have slightly different results.
|