Skip to content

Commit

Permalink
[FIX]fix with_mask to instance_seg (open-mmlab#181)
Browse files Browse the repository at this point in the history
* fix with_mask to instance_seg

* fix instance_cfg to instance-cfg
  • Loading branch information
VVsssssk authored Nov 9, 2021
1 parent cc4bfe1 commit c05a839
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_base_ = ['./mask_base_static.py']
_base_ = ['./base_instance-seg_static.py']
onnx_config = dict(
dynamic_axes={
'input': {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_base_ = [
'../_base_/base_instance-seg_dynamic.py',
'../../_base_/backends/onnxruntime.py'
]
4 changes: 4 additions & 0 deletions configs/mmdet/instance-seg/instance-seg_onnxruntime_static.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_base_ = [
'../_base_/base_instance-seg_static.py',
'../../_base_/backends/onnxruntime.py'
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_base_ = [
'../_base_/mask_base_dynamic.py', '../../_base_/backends/openvino.py'
'../_base_/base_instance-seg_dynamic.py',
'../../_base_/backends/openvino.py'
]

codebase_config = dict(post_processing=dict(export_postprocess_mask=False))
3 changes: 3 additions & 0 deletions configs/mmdet/instance-seg/instance-seg_ppl_dynamic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_base_ = [
'../_base_/base_instance-seg_dynamic.py', '../../_base_/backends/ppl.py'
]
5 changes: 5 additions & 0 deletions configs/mmdet/instance-seg/instance-seg_ppl_static.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_base_ = [
'../_base_/base_instance-seg_static.py', '../../_base_/backends/ppl.py'
]

codebase_config = dict(post_processing=dict(export_postprocess_mask=True))
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_base_ = [
'../_base_/mask_base_dynamic.py', '../../_base_/backends/tensorrt.py'
'../_base_/base_instance-seg_dynamic.py',
'../../_base_/backends/tensorrt.py'
]

backend_config = dict(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_base_ = [
'../_base_/mask_base_dynamic.py', '../../_base_/backends/tensorrt_fp16.py'
'../_base_/base_instance-seg_dynamic.py',
'../../_base_/backends/tensorrt_fp16.py'
]

backend_config = dict(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_base_ = [
'../_base_/mask_base_static.py', '../../_base_/backends/tensorrt_fp16.py'
'../_base_/base_instance-seg_static.py',
'../../_base_/backends/tensorrt_fp16.py'
]

onnx_config = dict(input_shape=(1344, 800))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_base_ = [
'../_base_/mask_base_dynamic.py', '../../_base_/backends/tensorrt_int8.py'
'../_base_/base_instance-seg_dynamic.py',
'../../_base_/backends/tensorrt_int8.py'
]

backend_config = dict(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
_base_ = ['../_base_/mask_base_static.py', '../../_base_/backends/tensorrt.py']
_base_ = [
'../_base_/base_instance-seg_static.py',
'../../_base_/backends/tensorrt_int8.py'
]

onnx_config = dict(input_shape=(1344, 800))
backend_config = dict(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_base_ = [
'../_base_/mask_base_static.py', '../../_base_/backends/tensorrt_int8.py'
'../_base_/base_instance-seg_static.py',
'../../_base_/backends/tensorrt.py'
]

onnx_config = dict(input_shape=(1344, 800))
Expand Down
3 changes: 0 additions & 3 deletions configs/mmdet/with-mask/mask_onnxruntime_dynamic.py

This file was deleted.

3 changes: 0 additions & 3 deletions configs/mmdet/with-mask/mask_onnxruntime_static.py

This file was deleted.

1 change: 0 additions & 1 deletion configs/mmdet/with-mask/mask_ppl_dynamic.py

This file was deleted.

3 changes: 0 additions & 3 deletions configs/mmdet/with-mask/mask_ppl_static.py

This file was deleted.

6 changes: 3 additions & 3 deletions tests/test_mmdet/test_mmdet_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def test_single_roi_extractor(backend_type):
model_output, backend_output, rtol=1e-03, atol=1e-05)


def get_cascade_roi_head(is_with_masks=False):
def get_cascade_roi_head(is_instance_seg=False):
"""CascadeRoIHead Config."""
num_stages = 3
stage_loss_weights = [1, 0.5, 0.25]
Expand Down Expand Up @@ -440,7 +440,7 @@ def get_cascade_roi_head(is_with_masks=False):

args = [num_stages, stage_loss_weights, bbox_roi_extractor, bbox_head]
kwargs = {'test_cfg': test_cfg}
if is_with_masks:
if is_instance_seg:
args += [mask_roi_extractor, mask_head]

from mmdet.models import CascadeRoIHead
Expand Down Expand Up @@ -739,7 +739,7 @@ def test_get_bboxes_of_atss_head(backend_type):
def test_cascade_roi_head_with_mask(backend_type):
pytest.importorskip(backend_type, reason=f'requires {backend_type}')

cascade_roi_head = get_cascade_roi_head(is_with_masks=True)
cascade_roi_head = get_cascade_roi_head(is_instance_seg=True)
seed_everything(1234)
x = [
torch.rand((1, 64, 200, 304)),
Expand Down

0 comments on commit c05a839

Please sign in to comment.