update rknn-toolkit2 to 1.0.0

Signed-off-by: Randall Zhuo <randall.zhuo@rock-chips.com>
Change-Id: I48fa3ee1f450bcb3412f456107805f556b2ed717
This commit is contained in:
Randall Zhuo 2021-04-30 19:56:59 +08:00
parent a4d3223144
commit 44b64209e8
23 changed files with 57 additions and 32 deletions

View File

@ -38,25 +38,26 @@ Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 Version
| **Operators** | **Remarks** |
| -------------------- | ----------- |
| BatchNorm |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| BatchNorm |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| bn (BatchNorm + Scale) |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br /> according to https://github.com/TimoSaemann/caffe-segnet-cudnn5|
| BNLL ||
| Concat |axis: 1,2,3|
| Convolution |channel: [1, 8192]<br />kernel height/width: [1, 31]<br />stride height/width: [1, 7]<br />kernels: [1, 8184]<br />pad left/right/top/bottom: [0, 15]<br />group: 1, channel / N <br /><br />|
| ConvolutionDepthwise |channel:[1, 8192]<br />kernel height/width: [1, 8]<br />stride height/width: [1, 7]<br />kernels: 1<br />pad left/right/top/bottom: [0, 15]|
| Crop ||
| Deconvolution |channel: [1, 8192]<br />kernel height/width: [1, 31]<br />stride height/width: 2, 4, 8<br />kernels: [1, 8192]<br />pad left/right/top/bottom: [0, 15]|
| BNLL ||
| Concat |axis: 1,2,3|
| Convolution |channel: [1, 8192]<br />kernel height/width: [1, 31]<br />stride height/width: [1, 7]<br />kernels: [1, 8184]<br />pad left/right/top/bottom: [0, 15]<br />group: 1, channel / N <br /><br />|
| ConvolutionDepthwise|channel:[1, 8192]<br />kernel height/width: [1, 8]<br />stride height/width: [1, 7]<br />kernels: 1<br />pad left/right/top/bottom: [0, 15]|
| Crop ||
| Deconvolution |channel: [1, 8192]<br />kernel height/width: [1, 31]<br />stride height/width: 2, 4, 8<br />kernels: [1, 8192]<br />pad left/right/top/bottom: [0, 15]|
| Dropout ||
| Eltwise |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />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**:<br />channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]<br /><br />**GlobalAveragePool**:<br />channel: [1, 8192]<br />kernel height/width: [1, 128]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7] <br /><br />**MaxPool/GlobalMaxPool**:<br />channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]<br /><br />**MaxPool**: <br />auto_pad only support NOTSETceil_mode only support 0unsupport dilations |
| Power ||
| Pooling | **AveragePool**:<br />channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]<br /><br />**GlobalAveragePool**:<br />channel: [1, 8192]<br />kernel height/width: [1, 128]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7] <br /><br />**MaxPool/GlobalMaxPool**:<br />channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]<br /><br />**MaxPool**: <br />auto_pad only support NOTSETceil_mode only support 0unsupport dilations |
| PRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />slope: per-layer/channel|
| Proposal |batch: 1|
| Reduction |output dims <= 4|
| Proposal |batch: 1|
| Reduction |output dims <= 4|
| Relu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| Relu6 |channel: [1, 8192]<br />height: [1, 8192]<br />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]<br />height: [1, 8192]<br />width: [1, 8176]|
| Sigmoid |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| Slice ||
| Slice ||
| Softmax ||
| Split ||
| TanH |channel: [1, 8192]<br />height: [1, 8192]<br />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]<br />kernel height/width: [1, 31]<br />stride height/width: [1, 7]<br />kernels: [1, 8184]<br />pad left/right/top/bottom: [0, 15]<br />dilation: [1, 31]<br />group: 1, channel / N|
| ConvTranspose |channel: [1, 8192]<br />kernel height/width: [1, 31]<br />stride height/width: 2, 4, 8<br />kernels: [1, 8192]<br />pad left/right/top/bottom: [0, 15]<br />dilation: [1, 31]<br />group: 1, channel / N|
| DepthToSpace ||
| Div |support broadcast rule: per-element/other|
| Div |support broadcast rule: per-element/other|
| Flatten ||
| Gemm |channel: [1, 8192]<br /> One input should be Const|
| GlobalAveragePool |channel: [1, 8192]<br />kernel height/width: [1, 128]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]|
| GlobalMaxPool |channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]|
| Greater |support broadcast rule: per-element/other|
| HardSigmoid ||
| LeakyRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| Less |support broadcast rule: per-element/other|
| LpNormalization |dims: 4|
| LpNormalization ||
| LRN ||
| MatMul |channel: [1, 8192]<br />dims: 2|
| MaxPool |channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]<br />auto_pad only support NOTSETceil_mode only support 0unsupport dilations|
| Max |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br /> dims=4|
| MaxPool |channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]<br />auto_pad only support NOTSETceil_mode only support 0unsupport dilations|
| MaxRoiPool ||
| MaxUnpool |unsupport pad|
| Mul |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />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]<br />height: [1, 8192]<br />width: [1, 8176]<br />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]<br />height: [1, 8192]<br />width: [1, 8176]|
| Tile ||
| Transpose ||
| Upsample (resize) || |

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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
更新内容:

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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')

View File

@ -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

View File

@ -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