-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature]: Support deployment of panoptic segmentation models (#2347)
* add semantic segmentation head Author: Daigo Hirooka <[email protected]> Date: Sun Jun 26 18:25:29 2022 +0900 * add panoptic detection model * add panoptic segmentation configs * support panoptic-fpn * remove interpolate * update * support panoptic-fpn mask2former maskformer * update * support dynamic * update * remove unused rewritings for mask2former * Revert "remove unused rewritings for mask2former" This reverts commit 2b6d24a. * update configs and regs * debug dynamic * fix for panoptic-fpn * update * remove rewritings for mask2former * update reg test config * fix * update docs * fix comments * fix --------- Co-authored-by: Daigo Hirooka <[email protected]>
- Loading branch information
1 parent
4dbba14
commit b7024dd
Showing
22 changed files
with
652 additions
and
106 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
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,15 @@ | ||
_base_ = ['../../_base_/onnx_config.py'] | ||
|
||
codebase_config = dict( | ||
type='mmdet', | ||
task='ObjectDetection', | ||
model_type='panoptic_end2end', | ||
post_processing=dict( | ||
export_postprocess_mask=False, | ||
score_threshold=0.0, | ||
iou_threshold=0.5, | ||
max_output_boxes_per_class=200, | ||
pre_top_k=5000, | ||
keep_top_k=100, | ||
background_label_id=-1, | ||
)) |
20 changes: 20 additions & 0 deletions
20
configs/mmdet/panoptic-seg/panoptic-seg_maskformer_onnxruntime_dynamic.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,20 @@ | ||
_base_ = [ | ||
'./panoptic-seg_maskformer_onnxruntime_static-800x1344.py', | ||
] | ||
onnx_config = dict( | ||
dynamic_axes={ | ||
'input': { | ||
0: 'batch', | ||
2: 'height', | ||
3: 'width' | ||
}, | ||
'cls_logits': { | ||
0: 'batch', | ||
}, | ||
'mask_logits': { | ||
0: 'batch', | ||
2: 'h', | ||
3: 'w', | ||
}, | ||
}, | ||
input_shape=None) |
8 changes: 8 additions & 0 deletions
8
configs/mmdet/panoptic-seg/panoptic-seg_maskformer_onnxruntime_static-800x1344.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,8 @@ | ||
_base_ = [ | ||
'../_base_/base_panoptic-seg_static.py', | ||
'../../_base_/backends/onnxruntime.py' | ||
] | ||
onnx_config = dict( | ||
opset_version=13, | ||
output_names=['cls_logits', 'mask_logits'], | ||
input_shape=[1344, 800]) |
27 changes: 27 additions & 0 deletions
27
configs/mmdet/panoptic-seg/panoptic-seg_maskformer_tensorrt_dynamic-320x512-1344x1344.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,27 @@ | ||
_base_ = ['./panoptic-seg_maskformer_tensorrt_static-800x1344.py'] | ||
onnx_config = dict( | ||
dynamic_axes={ | ||
'input': { | ||
0: 'batch', | ||
2: 'height', | ||
3: 'width' | ||
}, | ||
'cls_logits': { | ||
0: 'batch', | ||
}, | ||
'mask_logits': { | ||
0: 'batch', | ||
2: 'h', | ||
3: 'w', | ||
}, | ||
}, | ||
input_shape=None) | ||
|
||
backend_config = dict(model_inputs=[ | ||
dict( | ||
input_shapes=dict( | ||
input=dict( | ||
min_shape=[1, 3, 320, 512], | ||
opt_shape=[1, 3, 800, 1344], | ||
max_shape=[1, 3, 1344, 1344]))) | ||
]) |
19 changes: 19 additions & 0 deletions
19
configs/mmdet/panoptic-seg/panoptic-seg_maskformer_tensorrt_static-800x1344.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,19 @@ | ||
_base_ = [ | ||
'../_base_/base_panoptic-seg_static.py', | ||
'../../_base_/backends/tensorrt.py' | ||
] | ||
onnx_config = dict( | ||
opset_version=13, | ||
output_names=['cls_logits', 'mask_logits'], | ||
input_shape=[1344, 800]) | ||
|
||
backend_config = dict( | ||
common_config=dict(max_workspace_size=1 << 30), | ||
model_inputs=[ | ||
dict( | ||
input_shapes=dict( | ||
input=dict( | ||
min_shape=[1, 3, 800, 1344], | ||
opt_shape=[1, 3, 800, 1344], | ||
max_shape=[1, 3, 800, 1344]))) | ||
]) |
32 changes: 32 additions & 0 deletions
32
configs/mmdet/panoptic-seg/panoptic-seg_panoptic-fpn_onnxruntime_dynamic.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,32 @@ | ||
_base_ = [ | ||
'../_base_/base_panoptic-seg_static.py', | ||
'../../_base_/backends/onnxruntime.py' | ||
] | ||
onnx_config = dict( | ||
input_shape=None, | ||
output_names=['dets', 'labels', 'masks', 'semseg'], | ||
dynamic_axes={ | ||
'input': { | ||
0: 'batch', | ||
2: 'height', | ||
3: 'width' | ||
}, | ||
'dets': { | ||
0: 'batch', | ||
1: 'num_dets', | ||
}, | ||
'labels': { | ||
0: 'batch', | ||
1: 'num_dets', | ||
}, | ||
'masks': { | ||
0: 'batch', | ||
1: 'num_dets', | ||
}, | ||
'semseg': { | ||
0: 'batch', | ||
2: 'height', | ||
3: 'width' | ||
}, | ||
}, | ||
) |
43 changes: 43 additions & 0 deletions
43
configs/mmdet/panoptic-seg/panoptic-seg_panoptic-fpn_tensorrt_dynamic-352x512-1344x1344.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,43 @@ | ||
_base_ = [ | ||
'../_base_/base_panoptic-seg_static.py', | ||
'../../_base_/backends/tensorrt.py' | ||
] | ||
onnx_config = dict( | ||
input_shape=None, | ||
output_names=['dets', 'labels', 'masks', 'semseg'], | ||
dynamic_axes={ | ||
'input': { | ||
0: 'batch', | ||
2: 'height', | ||
3: 'width' | ||
}, | ||
'dets': { | ||
0: 'batch', | ||
1: 'num_dets', | ||
}, | ||
'labels': { | ||
0: 'batch', | ||
1: 'num_dets', | ||
}, | ||
'masks': { | ||
0: 'batch', | ||
1: 'num_dets', | ||
}, | ||
'semseg': { | ||
0: 'batch', | ||
2: 'height', | ||
3: 'width' | ||
}, | ||
}, | ||
) | ||
|
||
backend_config = dict( | ||
common_config=dict(max_workspace_size=1 << 30), | ||
model_inputs=[ | ||
dict( | ||
input_shapes=dict( | ||
input=dict( | ||
min_shape=[1, 3, 352, 512], | ||
opt_shape=[1, 3, 800, 1344], | ||
max_shape=[1, 3, 1344, 1344]))) | ||
]) |
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.