diff --git a/doc/RKNNToolKit2_OP_Support-v0.7.0.md b/doc/RKNNToolKit2_OP_Support_v1.0.0.md similarity index 86% rename from doc/RKNNToolKit2_OP_Support-v0.7.0.md rename to doc/RKNNToolKit2_OP_Support_v1.0.0.md index b353962..b66d998 100644 --- a/doc/RKNNToolKit2_OP_Support-v0.7.0.md +++ b/doc/RKNNToolKit2_OP_Support_v1.0.0.md @@ -38,25 +38,26 @@ Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 Version | **Operators** | **Remarks** | | -------------------- | ----------- | -| BatchNorm |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| +| BatchNorm |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| | bn (BatchNorm + Scale) |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]
according to https://github.com/TimoSaemann/caffe-segnet-cudnn5| -| BNLL || -| Concat |axis: 1,2,3| -| Convolution |channel: [1, 8192]
kernel height/width: [1, 31]
stride height/width: [1, 7]
kernels: [1, 8184]
pad left/right/top/bottom: [0, 15]
group: 1, channel / N

| -| ConvolutionDepthwise |channel:[1, 8192]
kernel height/width: [1, 8]
stride height/width: [1, 7]
kernels: 1
pad left/right/top/bottom: [0, 15]| -| Crop || -| Deconvolution |channel: [1, 8192]
kernel height/width: [1, 31]
stride height/width: 2, 4, 8
kernels: [1, 8192]
pad left/right/top/bottom: [0, 15]| +| BNLL || +| Concat |axis: 1,2,3| +| Convolution |channel: [1, 8192]
kernel height/width: [1, 31]
stride height/width: [1, 7]
kernels: [1, 8184]
pad left/right/top/bottom: [0, 15]
group: 1, channel / N

| +| ConvolutionDepthwise|channel:[1, 8192]
kernel height/width: [1, 8]
stride height/width: [1, 7]
kernels: 1
pad left/right/top/bottom: [0, 15]| +| Crop || +| Deconvolution |channel: [1, 8192]
kernel height/width: [1, 31]
stride height/width: 2, 4, 8
kernels: [1, 8192]
pad left/right/top/bottom: [0, 15]| | Dropout || | Eltwise |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]
support broadcast rule: per-layer/channel/element| | Flatten || -| InnerProduct |channel: [1, 8192]| -| LRN || -| Normalize |dims: 4| +| InnerProduct |channel: [1, 8192]| +| LRN || +| Normalize || | Permute || -| Pooling | **AveragePool**:
channel: [1, 8192]
kernel height/width: [1, 7]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]

**GlobalAveragePool**:
channel: [1, 8192]
kernel height/width: [1, 128]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]

**MaxPool/GlobalMaxPool**:
channel: [1, 8192]
kernel height/width: [1, 7]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]

**MaxPool**:
auto_pad only support NOTSET,ceil_mode only support 0,unsupport dilations | +| Power || +| Pooling | **AveragePool**:
channel: [1, 8192]
kernel height/width: [1, 7]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]

**GlobalAveragePool**:
channel: [1, 8192]
kernel height/width: [1, 128]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]

**MaxPool/GlobalMaxPool**:
channel: [1, 8192]
kernel height/width: [1, 7]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]

**MaxPool**:
auto_pad only support NOTSET,ceil_mode only support 0,unsupport dilations | | PRelu |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]
slope: per-layer/channel| -| Proposal |batch: 1| -| Reduction |output dims <= 4| +| Proposal |batch: 1| +| Reduction |output dims <= 4| | Relu |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| | Relu6 |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| | Reorg || @@ -66,10 +67,11 @@ Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 Version | ROIPooling |according to https://github.com/twmht/caffe-pva-faster-rcnn| | Scale |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| | Sigmoid |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| -| Slice || +| Slice || | Softmax || | Split || | TanH |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| +| Tile || | Transpose || | Upsample |according to https://github.com/SeanQ88/caffe_upsample and https://github.com/TimoSaemann/caffe-segnet-cudnn5| @@ -88,22 +90,25 @@ The list of ONNX OPs supported by RKNN Toolkit2 Version 0.6.0 is as follows: | Conv |channel: [1, 8192]
kernel height/width: [1, 31]
stride height/width: [1, 7]
kernels: [1, 8184]
pad left/right/top/bottom: [0, 15]
dilation: [1, 31]
group: 1, channel / N| | ConvTranspose |channel: [1, 8192]
kernel height/width: [1, 31]
stride height/width: 2, 4, 8
kernels: [1, 8192]
pad left/right/top/bottom: [0, 15]
dilation: [1, 31]
group: 1, channel / N| | DepthToSpace || -| Div |support broadcast rule: per-element/other| +| Div |support broadcast rule: per-element/other| | Flatten || | Gemm |channel: [1, 8192]
One input should be Const| | GlobalAveragePool |channel: [1, 8192]
kernel height/width: [1, 128]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]| | GlobalMaxPool |channel: [1, 8192]
kernel height/width: [1, 7]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]| | Greater |support broadcast rule: per-element/other| +| HardSigmoid || | LeakyRelu |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| | Less |support broadcast rule: per-element/other| -| LpNormalization |dims: 4| +| LpNormalization || | LRN || | MatMul |channel: [1, 8192]
dims: 2| -| MaxPool |channel: [1, 8192]
kernel height/width: [1, 7]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]
auto_pad only support NOTSET,ceil_mode only support 0,unsupport dilations| +| Max |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]
dims=4| +| MaxPool |channel: [1, 8192]
kernel height/width: [1, 7]
stride height/width: [1, 8]
pad left/right/top/bottom: [0, 7]
auto_pad only support NOTSET,ceil_mode only support 0,unsupport dilations| | MaxRoiPool || | MaxUnpool |unsupport pad| | Mul |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]
support broadcast rule: per-layer/channel/element| | Pad |pad value should >= 0; pad dims must be 2 when mode is reflect or edge| +| Pow || | PRelu |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]
slope support broadcast rule:: per-layer/channel| | ReduceMean |output dims <= 4| | ReduceSum |output dims <= 4| @@ -118,6 +123,7 @@ The list of ONNX OPs supported by RKNN Toolkit2 Version 0.6.0 is as follows: | Split || | Squeeze || | Tanh |channel: [1, 8192]
height: [1, 8192]
width: [1, 8176]| +| Tile || | Transpose || | Upsample (resize) || | diff --git a/doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v0.7.0.pdf b/doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v0.7.0.pdf deleted file mode 100644 index a0290b4..0000000 Binary files a/doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v0.7.0.pdf and /dev/null differ diff --git a/doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v1.0.0.pdf b/doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v1.0.0.pdf new file mode 100644 index 0000000..5acc38d Binary files /dev/null and b/doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v1.0.0.pdf differ diff --git a/doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v0.7.0.pdf b/doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v0.7.0.pdf deleted file mode 100644 index 273f2d9..0000000 Binary files a/doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v0.7.0.pdf and /dev/null differ diff --git a/doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v1.0.0.pdf b/doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v1.0.0.pdf new file mode 100644 index 0000000..079a314 Binary files /dev/null and b/doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v1.0.0.pdf differ diff --git a/doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v0.7.0.pdf b/doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v0.7.0.pdf deleted file mode 100644 index 6ac3728..0000000 Binary files a/doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v0.7.0.pdf and /dev/null differ diff --git a/doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v1.0.0.pdf b/doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v1.0.0.pdf new file mode 100644 index 0000000..620bd3e Binary files /dev/null and b/doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v1.0.0.pdf differ diff --git a/doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v0.7.0.pdf b/doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v0.7.0.pdf deleted file mode 100644 index e352919..0000000 Binary files a/doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v0.7.0.pdf and /dev/null differ diff --git a/doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v1.0.0.pdf b/doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v1.0.0.pdf new file mode 100644 index 0000000..3a54fa3 Binary files /dev/null and b/doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v1.0.0.pdf differ diff --git a/doc/changelog-v0.7.0.txt b/doc/changelog_v1.0.0.txt similarity index 57% rename from doc/changelog-v0.7.0.txt rename to doc/changelog_v1.0.0.txt index 64ef4d5..681a000 100644 --- a/doc/changelog-v0.7.0.txt +++ b/doc/changelog_v1.0.0.txt @@ -1,3 +1,24 @@ +2021-4-30 +版本:v1.0.0 +更新内容: +1. 新功能: + 1)卷积类的per channel量化功能 + 2)添加了config中custom_string的模型信息设置、img_quant_RGB2BGR设置 + 3)添加了eval performance的性能测试接口 + 4)添加了连板调试功能 +2. OP支持: + 1) 添加了Caffe新OP支持:Power/Tile/Eltwise(Max)/去除了normalize维度的限制 + 2) 添加了onnx新OP支持:HardSigmoid/Pow/Tile +3. 修复一些已知的bug: + 1) 修复了caffe FC的输出shape以及name的错误 + 2) 优化了mmse的量化性能 + 3)修复caffe的Pooling层的输出shape计算错误 + 4)修复了caffe slice丢弃了其中一个输出的inference bug + 5)修复了caffe scale层的计算错误 +4. 弃置了reorder_channel的config设置,由用户自行保证inference输入数据的channel正确性 + + + 2021-4-2 版本:v0.7.0 更新内容: diff --git a/doc/requirements-v0.7.0.txt b/doc/requirements_v1.0.0.txt similarity index 100% rename from doc/requirements-v0.7.0.txt rename to doc/requirements_v1.0.0.txt diff --git a/examples/caffe/mobilenet_v2/test.py b/examples/caffe/mobilenet_v2/test.py index 4f8ad95..859d53e 100755 --- a/examples/caffe/mobilenet_v2/test.py +++ b/examples/caffe/mobilenet_v2/test.py @@ -26,7 +26,7 @@ if __name__ == '__main__': # pre-process config print('--> config model') - rknn.config(mean_values=[103.94, 116.78, 123.68], std_values=[58.82, 58.82, 58.82], reorder_channel=True) + rknn.config(mean_values=[103.94, 116.78, 123.68], std_values=[58.82, 58.82, 58.82], quant_img_RGB2BGR=True) print('done') # Load tensorflow model @@ -57,7 +57,6 @@ if __name__ == '__main__': # Set inputs img = cv2.imread('./goldfish_224x224.jpg') - img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) print('--> Init runtime environment') ret = rknn.init_runtime() diff --git a/examples/caffe/vgg-ssd/test.py b/examples/caffe/vgg-ssd/test.py index 4cc3664..fd85ce6 100644 --- a/examples/caffe/vgg-ssd/test.py +++ b/examples/caffe/vgg-ssd/test.py @@ -160,7 +160,7 @@ if __name__ == '__main__': # pre-process config print('--> config model') - rknn.config(mean_values=[103.94, 116.78, 123.68], std_values=[1, 1, 1], reorder_channel=True) + rknn.config(mean_values=[103.94, 116.78, 123.68], std_values=[1, 1, 1], quant_img_RGB2BGR=True) print('done') # Load tensorflow model @@ -191,7 +191,6 @@ if __name__ == '__main__': # Set inputs img = cv2.imread('./road_300x300.jpg') - img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) print('--> Init runtime environment') ret = rknn.init_runtime() diff --git a/examples/darknet/yolov3_416x416/test.py b/examples/darknet/yolov3_416x416/test.py index 79e17fb..a0d4587 100755 --- a/examples/darknet/yolov3_416x416/test.py +++ b/examples/darknet/yolov3_416x416/test.py @@ -26,7 +26,7 @@ if __name__ == '__main__': # pre-process config print('--> config model') - rknn.config(mean_values=[0, 0, 0], std_values=[255, 255, 255], reorder_channel=False) + rknn.config(mean_values=[0, 0, 0], std_values=[255, 255, 255]) print('done') # Load tensorflow model @@ -91,8 +91,8 @@ if __name__ == '__main__': if boxes is not None: draw(image, boxes, scores, classes) - cv2.imshow("results", image) - cv2.waitKeyEx(0) + print('Save results to results.jpg!') + cv2.imwrite('results.jpg', image) rknn.release() diff --git a/examples/common_function_demos/load_quantized_model/README.md b/examples/load_quantized_model/README.md similarity index 100% rename from examples/common_function_demos/load_quantized_model/README.md rename to examples/load_quantized_model/README.md diff --git a/examples/common_function_demos/load_quantized_model/goldfish_299x299.jpg b/examples/load_quantized_model/goldfish_299x299.jpg similarity index 100% rename from examples/common_function_demos/load_quantized_model/goldfish_299x299.jpg rename to examples/load_quantized_model/goldfish_299x299.jpg diff --git a/examples/common_function_demos/load_quantized_model/test.py b/examples/load_quantized_model/test.py similarity index 99% rename from examples/common_function_demos/load_quantized_model/test.py rename to examples/load_quantized_model/test.py index f07f70d..5ebbd6d 100755 --- a/examples/common_function_demos/load_quantized_model/test.py +++ b/examples/load_quantized_model/test.py @@ -101,7 +101,7 @@ if __name__ == '__main__': print('done') # pre-process config print('--> Config model') - rknn.config(reorder_channel=False) + rknn.config() print('done') # Load tensorflow model diff --git a/examples/onnx/resnet50v2/test.py b/examples/onnx/resnet50v2/test.py index 71de9f3..008f152 100644 --- a/examples/onnx/resnet50v2/test.py +++ b/examples/onnx/resnet50v2/test.py @@ -80,7 +80,7 @@ if __name__ == '__main__': print('done') # print('--> config model') - rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.82, 58.82, 58.82], reorder_channel=False) + rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.82, 58.82, 58.82]) print('done') # Load model diff --git a/examples/pytorch/resnet18/test.py b/examples/pytorch/resnet18/test.py index bd851c0..3fe6016 100644 --- a/examples/pytorch/resnet18/test.py +++ b/examples/pytorch/resnet18/test.py @@ -50,7 +50,7 @@ if __name__ == '__main__': # pre-process config print('--> config model') - rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.395, 58.395, 58.395], reorder_channel=False) + rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.395, 58.395, 58.395]) print('done') # Load pytorch model diff --git a/examples/tensorflow/ssd_mobilenet_v1/test.py b/examples/tensorflow/ssd_mobilenet_v1/test.py index 323b071..f3c7a05 100755 --- a/examples/tensorflow/ssd_mobilenet_v1/test.py +++ b/examples/tensorflow/ssd_mobilenet_v1/test.py @@ -60,7 +60,7 @@ if __name__ == '__main__': rknn = RKNN() # Config for Model Input PreProcess - rknn.config(mean_values=[127.5, 127.5, 127.5], std_values=[127.5, 127.5, 127.5], reorder_channel=False) + rknn.config(mean_values=[127.5, 127.5, 127.5], std_values=[127.5, 127.5, 127.5]) # Load TensorFlow Model print('--> Loading model') diff --git a/examples/tflite/mobilenet_v1/test.py b/examples/tflite/mobilenet_v1/test.py index b71b218..891a379 100755 --- a/examples/tflite/mobilenet_v1/test.py +++ b/examples/tflite/mobilenet_v1/test.py @@ -24,11 +24,11 @@ def show_outputs(outputs): if __name__ == '__main__': # Create RKNN object - rknn = RKNN(verbose=True) + rknn = RKNN() # pre-process config print('--> config model') - rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128], reorder_channel=False) + rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128]) print('done') # Load tensorflow model diff --git a/examples/tflite/mobilenet_v1_quant/test.py b/examples/tflite/mobilenet_v1_quant/test.py index 16e5b66..a782e11 100755 --- a/examples/tflite/mobilenet_v1_quant/test.py +++ b/examples/tflite/mobilenet_v1_quant/test.py @@ -24,11 +24,11 @@ def show_outputs(outputs): if __name__ == '__main__': # Create RKNN object - rknn = RKNN(verbose=True) + rknn = RKNN() # pre-process config print('--> config model') - rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128], reorder_channel=False) + rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128]) print('done') # Load tensorflow model diff --git a/packages/rknn_toolkit2-0.7.0-cp36-cp36m-linux_x86_64.whl b/packages/rknn_toolkit2-1.0.0-cp36-cp36m-linux_x86_64.whl similarity index 62% rename from packages/rknn_toolkit2-0.7.0-cp36-cp36m-linux_x86_64.whl rename to packages/rknn_toolkit2-1.0.0-cp36-cp36m-linux_x86_64.whl index 9b8d0de..47b9819 100644 Binary files a/packages/rknn_toolkit2-0.7.0-cp36-cp36m-linux_x86_64.whl and b/packages/rknn_toolkit2-1.0.0-cp36-cp36m-linux_x86_64.whl differ