-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add YOLOv5 support for RV1126 device. (#1321)
* support pose simcc * fix yolov5 create_input * add yolov5 post process and update mmcls.yml * add letter resize * add yolov5 export info * fix * add pose face config * pick 4dd4d48 * fix yolov5 head * fix ut * refactor mmpose config * pass output_names outside * rknn batch size * lint * add input names to wrapper * update according to open-mmlab/mmyolo#305 * add pre_compile option * update doc and fix typo * fix padding * fix typo * use throw_exception
- Loading branch information
Showing
44 changed files
with
853 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
backend_config = dict( | ||
type='rknn', | ||
common_config=dict( | ||
mean_values=None, # [[103.53, 116.28, 123.675]], | ||
std_values=None, # [[57.375, 57.12, 58.395]], | ||
target_platform='rv1126', # 'rk3588' | ||
optimization_level=1), | ||
quantization_config=dict(do_quantization=False, dataset=None)) | ||
quantization_config=dict( | ||
do_quantization=True, | ||
dataset=None, | ||
pre_compile=False, | ||
rknn_batch_size=-1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
_base_ = ['./classification_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[224, 224]) | ||
codebase_config = dict(model_type='end2end') | ||
backend_config = dict( | ||
input_size_list=[[3, 224, 224]], | ||
quantization_config=dict(do_quantization=False)) |
2 changes: 1 addition & 1 deletion
2
...cls/classification_rknn_static-224x224.py → ...lassification_rknn-int8_static-224x224.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
_base_ = ['./classification_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[224, 224]) | ||
codebase_config = dict(model_type='rknn') | ||
codebase_config = dict(model_type='end2end') | ||
backend_config = dict(input_size_list=[[3, 224, 224]]) |
34 changes: 34 additions & 0 deletions
34
configs/mmdet/detection/detection_rknn-fp16_static-320x320.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
_base_ = ['../_base_/base_static.py', '../../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[320, 320]) | ||
|
||
codebase_config = dict(model_type='rknn') | ||
|
||
backend_config = dict( | ||
input_size_list=[[3, 320, 320]], | ||
quantization_config=dict(do_quantization=False)) | ||
|
||
# # yolov3, yolox for rknn-toolkit and rknn-toolkit2 | ||
# partition_config = dict( | ||
# type='rknn', # the partition policy name | ||
# apply_marks=True, # should always be set to True | ||
# partition_cfg=[ | ||
# dict( | ||
# save_file='model.onnx', # name to save the partitioned onnx | ||
# start=['detector_forward:input'], # [mark_name:input, ...] | ||
# end=['yolo_head:input'], # [mark_name:output, ...] | ||
# output_names=[f'pred_maps.{i}' for i in range(3)]) # out names | ||
# ]) | ||
|
||
# # retinanet, ssd, fsaf for rknn-toolkit2 | ||
# partition_config = dict( | ||
# type='rknn', # the partition policy name | ||
# apply_marks=True, | ||
# partition_cfg=[ | ||
# dict( | ||
# save_file='model.onnx', | ||
# start='detector_forward:input', | ||
# end=['BaseDenseHead:output'], | ||
# output_names=[f'BaseDenseHead.cls.{i}' for i in range(5)] + | ||
# [f'BaseDenseHead.loc.{i}' for i in range(5)]) | ||
# ]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
_base_ = ['./pose-detection_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[192, 256]) | ||
|
||
codebase_config = dict(model_type='end2end') | ||
|
||
backend_config = dict( | ||
input_size_list=[[3, 256, 192]], | ||
quantization_config=dict(do_quantization=False), | ||
common_config=dict(target_platform='rv1126')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
_base_ = ['./pose-detection_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[256, 256]) | ||
|
||
codebase_config = dict(model_type='end2end') | ||
|
||
backend_config = dict( | ||
input_size_list=[[3, 256, 256]], | ||
quantization_config=dict(do_quantization=False), | ||
common_config=dict(target_platform='rv1126')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_base_ = ['./pose-detection_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[192, 256]) | ||
|
||
codebase_config = dict(model_type='end2end') | ||
|
||
backend_config = dict( | ||
input_size_list=[[3, 256, 192]], | ||
common_config=dict(target_platform='rv1126')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_base_ = ['./pose-detection_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[256, 256]) | ||
|
||
codebase_config = dict(model_type='end2end') | ||
|
||
backend_config = dict( | ||
input_size_list=[[3, 256, 256]], | ||
common_config=dict(target_platform='rv1126')) |
7 changes: 7 additions & 0 deletions
7
configs/mmpose/pose-detection_simcc_rknn-fp16_static-256x192.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
_base_ = ['./pose-detection_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[192, 256], output_names=['simcc_x', 'simcc_y']) | ||
|
||
backend_config = dict( | ||
input_size_list=[[3, 256, 192]], | ||
quantization_config=dict(do_quantization=False)) |
5 changes: 5 additions & 0 deletions
5
configs/mmpose/pose-detection_simcc_rknn-int8_static-256x192.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_base_ = ['./pose-detection_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[192, 256], output_names=['simcc_x', 'simcc_y']) | ||
|
||
backend_config = dict(input_size_list=[[3, 256, 192]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_base_ = ['./segmentation_static.py', '../_base_/backends/rknn.py'] | ||
|
||
onnx_config = dict(input_shape=[320, 320]) | ||
|
||
codebase_config = dict(model_type='rknn') | ||
|
||
backend_config = dict( | ||
input_size_list=[[3, 320, 320]], | ||
quantization_config=dict(do_quantization=False)) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.