Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
zen-xingle 5ff298c8d4 | 3 years ago | |
---|---|---|
.github | 3 years ago | |
data | 3 years ago | |
models | 3 years ago | |
rknn_convert_tools | 3 years ago | |
utils | 3 years ago | |
weights | 3 years ago | |
.dockerignore | 3 years ago | |
.gitattributes | 3 years ago | |
.gitignore | 3 years ago | |
Dockerfile | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
detect.py | 3 years ago | |
hubconf.py | 3 years ago | |
requirements.txt | 3 years ago | |
test.py | 3 years ago | |
train.py | 3 years ago | |
tutorial.ipynb | 3 years ago |
原版仓库:https://github.com/ultralytics/yolov5
环境要求:python version >= 3.6
模型训练:python3 train.py
模型导出:python3 models/export.py --rknn_mode
模型预测:python3 detect.py --rknn_mode
将common文件中激活层修改为ReLU,此外模型结构、训练、测试及其他操作均与原版本 Yolov5 一致。模型测试、导出时增添 rknn_mode 模式,导出对rknn友好型模型。(基于opset_version=10, rknn_toolkit_1.6.0测试通过)
实现细节:
4.29更新:
导出模型可选择去掉尾端的permute层,从而兼容rknn_yolov5_demo的c++部署代码
python3 models/export.py --rknn_mode --ignore_output_permute
导出模型可选择增加图片预处理层,可有效降低部署段 rknn_input_set 的时间耗时。具体使用方法参考 models/common_rk_plug_in.py 里的 preprocess_conv_layer 的说明。
python3 models/export.py --rknn_mode --add_image_preprocess_layer
(rknn_mode、ignore_output_permute、add_image_preprocess_layer 三者不互斥,可同时使用)
增加onnx->rknn模型导出工具,详见rknn_convert_tools文件夹。
模型(416x416输入) | rknn_toolkit_1.6.0模拟器评估(800MHZ)_rv1109 | rv11093 | rv1109(模型预编译) | rv1126 | rv1126(模型预编译) | rknn_toolkit_1.6.0模拟器评估(800MHZ)_rk1808 | rk1808 | rk1808(模型预编译) |
---|---|---|---|---|---|---|---|---|
yolov5s_int81 | 92 | 113 | 80 | 77 | 89 | 83 | 81 | |
yolov5s_int8_optimize2 | 18 | 45 | 36 | 33 | 15 | 30 | 29 | |
yolov5s_int16 | 149 | 160 | 110 | 108 | 106 | 178 | 174 | |
yolov5s_int16_optimize | 76 | 90 | 67 | 64 | 32 | 126 | 122 | |
yolov5m_int8 | 158 | 192 | 132 | 120 | 144 | 132 | 123 | |
yolov5m_int8_optimize | 47 | 88 | 66 | 55 | 33 | 54 | 45 | |
yolov5m_int16 | 312 | 302 | 212 | 202 | 187 | 432 | 418 | |
yolov5m_int16_optimize | 202 | 198 | 147 | 137 | 76 | 354 | 344 | |
yolov5l_int8 | 246 | 293 | 199 | 214 | 192 | |||
yolov5l_int8_optimize | 98 | 155 | 110 | 66 | 88 | |||
yolov5l_int16 | 577 | 522 | 362 | 301 | 697 | |||
yolov5l_int16_optimize | 432 | 384 | 275 | 154 | 592 |
1: 是指基于原版的yaml配置,激活层修改为relu。
2: optimize是指在导出模型时对 大尺寸maxpool 进行优化,现已开源,导出参数 --rknn_mode 时默认使用。不会影响精度。
3: 统计时间包含 rknn_inputs_set、rknn_run、rknn_outputs_get 三部分时间,不包含cpu端后处理时间。除模拟器评估外,本表其他平台的测试均遵循此原则。
4: 该测试仅供参考,测试时为单线程循环执行计时,仅测试npu效率。实际使用时应该考虑后处理的时间。
5: 本库仅涉及 python 端的开发, 暂不涉及 部署端代码。
https://github.com/soloIife/yolov5_for_rknn
https://github.com/ultralytics/yolov5
QQ群:810456486
No Description
Jupyter Notebook Python Shell Markdown Dockerfile other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》