Skip to content

Commit a17e2f5

Browse files
committed
pre-commit update
1 parent fbac65e commit a17e2f5

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

configs/mmdet/instance-seg/instance-seg_tensorrt_dynamic-320x320-1344x1344.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
]
55

66
backend_config = dict(
7-
common_config=dict(max_workspace_size=1 << 30),
7+
common_config=dict(max_workspace_size=1 << 32),
88
model_inputs=[
99
dict(
1010
input_shapes=dict(

mmdeploy/codebase/mmdet/models/dense_heads/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22
from . import base_dense_head # noqa: F401,F403
33
from . import centernet_head # noqa: F401,F403
4+
from . import condinst_head # noqa: F401,F403
45
from . import detr_head # noqa: F401,F403
56
from . import fovea_head # noqa: F401,F403
67
from . import gfl_head # noqa: F401,F403
@@ -12,4 +13,3 @@
1213
from . import solov2_head # noqa: F401,F403
1314
from . import yolo_head # noqa: F401,F403
1415
from . import yolox_head # noqa: F401,F403
15-
from . import condinst_head # noqa: F401,F403

mmdeploy/codebase/mmdet/models/dense_heads/condinst_head.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def condinst_mask_head__forward(self, x: tuple,
137137
weights, biases = _parse_dynamic_params(self, param_preds)
138138
mask_preds = _dynamic_conv_forward(mask_head_inputs, weights, biases)
139139
mask_preds = mask_preds.reshape(batch_size, num_insts, hw[0], hw[1])
140-
mask_preds = aligned_bilinear(mask_preds,
141-
int(self.mask_feat_stride / self.mask_out_stride))
140+
mask_preds = aligned_bilinear(
141+
mask_preds, int(self.mask_feat_stride / self.mask_out_stride))
142142
return (mask_preds, )
143143

144144

mmdeploy/pytorch/functions/repeat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def tensor__repeat__tensorrt(input: torch.Tensor, *size: Union[torch.Size,
2020
origin_func = ctx.origin_func
2121
if input.dim() == 1 and len(size) == 1:
2222
if isinstance(*size, tuple):
23-
return origin_func(input.unsqueeze(0), *([1] + list(*size))).squeeze(0)
23+
return origin_func(input.unsqueeze(0),
24+
*([1] + list(*size))).squeeze(0)
2425
return origin_func(input.unsqueeze(0), *([1] + list(size))).squeeze(0)
2526
else:
2627
return origin_func(input, *size)

tests/test_codebase/test_mmdet/test_mmdet_models.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,7 +2487,7 @@ def test_condinst_bbox_head_predict_by_feat(backend_type):
24872487
wrapped_model=wrapped_model,
24882488
model_inputs=rewrite_inputs,
24892489
deploy_cfg=deploy_cfg)
2490-
2490+
24912491
if is_backend_output:
24922492
dets = rewrite_outputs[0]
24932493
labels = rewrite_outputs[1]
@@ -2571,18 +2571,18 @@ def test_condinst_mask_head_predict_by_feat(backend_type):
25712571
max_shape=[1, 3, 1344, 1344])))
25722572
]),
25732573
onnx_config=dict(output_names=output_names, input_shape=None),
2574-
codebase_config=dict(
2575-
type='mmdet',
2576-
task='ObjectDetection')))
2577-
2574+
codebase_config=dict(type='mmdet', task='ObjectDetection')))
2575+
25782576
class TestCondInstMaskHeadModel(torch.nn.Module):
2577+
25792578
def __init__(self, condinst_mask_head):
25802579
super(TestCondInstMaskHeadModel, self).__init__()
25812580
self.mask_head = condinst_mask_head
25822581

25832582
def predict_by_feat(self, mask_preds, det, label, batch_img_metas):
25842583
results = dict(dets=det, labels=label)
2585-
return self.mask_head.predict_by_feat(mask_preds, results, batch_img_metas)
2584+
return self.mask_head.predict_by_feat(mask_preds, results,
2585+
batch_img_metas)
25862586

25872587
head = get_condinst_mask_head()
25882588
condinst_mask_head = TestCondInstMaskHeadModel(head)
@@ -2597,11 +2597,7 @@ def predict_by_feat(self, mask_preds, det, label, batch_img_metas):
25972597
# to get outputs of onnx/tensorrt model after rewrite
25982598
wrapped_model = WrapModel(
25992599
condinst_mask_head, 'predict_by_feat', batch_img_metas=batch_img_metas)
2600-
rewrite_inputs = {
2601-
'mask_preds': mask_preds,
2602-
'det': dets,
2603-
'label': labels
2604-
}
2600+
rewrite_inputs = {'mask_preds': mask_preds, 'det': dets, 'label': labels}
26052601
rewrite_outputs, is_backend_output = get_rewrite_outputs(
26062602
wrapped_model=wrapped_model,
26072603
model_inputs=rewrite_inputs,

0 commit comments

Comments
 (0)