Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mmdet ut #1001

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/02-how-to-run/useful_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ python tools/profiler.py \
python tools/profiler.py \
configs/mmcls/classification_tensorrt_dynamic-224x224-224x224.py \
../mmclassification/configs/resnet/resnet18_8xb32_in1k.py \
../mmdetection/demo \
../mmclassification/demo/ \
--model work-dirs/mmcls/resnet/trt/end2end.engine \
--device cuda \
--shape 224x224 \
Expand Down
2 changes: 1 addition & 1 deletion docs/zh_cn/02-how-to-run/useful_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ python tools/profiler.py \
python tools/profiler.py \
configs/mmcls/classification_tensorrt_dynamic-224x224-224x224.py \
../mmclassification/configs/resnet/resnet18_8xb32_in1k.py \
../mmdetection/demo \
../mmclassification/demo/ \
--model work-dirs/mmcls/resnet/trt/end2end.engine \
--device cuda \
--shape 224x224 \
Expand Down
13 changes: 3 additions & 10 deletions tests/regression/mmdet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,17 @@ onnxruntime:

pipeline_ort_dynamic_fp32: &pipeline_ort_dynamic_fp32
convert_image: *convert_image
backend_test: *default_backend_test
sdk_config: *sdk_dynamic
backend_test: False
deploy_config: configs/mmdet/detection/detection_onnxruntime_dynamic.py

pipeline_seg_ort_static_fp32: &pipeline_seg_ort_static_fp32
convert_image: *convert_image
backend_test: *default_backend_test
# sdk_config: *sdk_seg_static
backend_test: False
deploy_config: configs/mmdet/instance-seg/instance-seg_onnxruntime_static.py

pipeline_seg_ort_dynamic_fp32: &pipeline_seg_ort_dynamic_fp32
convert_image: *convert_image
backend_test: *default_backend_test
sdk_config: *sdk_seg_dynamic
backend_test: False
deploy_config: configs/mmdet/instance-seg/instance-seg_onnxruntime_dynamic.py

tensorrt:
Expand Down Expand Up @@ -188,11 +185,7 @@ models:
convert_image: *convert_image
backend_test: *default_backend_test
sdk_config: *sdk_dynamic
# - *pipeline_trt_dynamic_fp32
# - *pipeline_trt_dynamic_fp16
# - *pipeline_trt_dynamic_int8
- *pipeline_ncnn_static_fp32
# - *pipeline_pplnn_dynamic_fp32
- *pipeline_openvino_dynamic_fp32

- name: SSD
Expand Down
4 changes: 2 additions & 2 deletions tests/regression/mmdet3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ globals:
onnxruntime:
pipeline_ort_dynamic_kitti_fp32: &pipeline_ort_dynamic_kitti_fp32
convert_image: *convert_image
backend_test: *default_backend_test
backend_test: False
deploy_config: configs/mmdet3d/voxel-detection/voxel-detection_onnxruntime_dynamic.py

pipeline_ort_dynamic_nus_fp32: &pipeline_ort_dynamic_nus_fp32
convert_image: *convert_image_nus
backend_test: *default_backend_test
backend_test: False
deploy_config: configs/mmdet3d/voxel-detection/voxel-detection_onnxruntime_dynamic.py

tensorrt:
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/mmrotate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ onnxruntime:
# ======= detection =======
pipeline_ort_detection_static_fp32: &pipeline_ort_detection_static_fp32
convert_image: *convert_image_det
backend_test: *default_backend_test
backend_test: False
deploy_config: configs/mmrotate/rotated-detection_onnxruntime_static.py

pipeline_ort_detection_dynamic_fp32: &pipeline_ort_detection_dynamic_fp32
Expand Down
7 changes: 4 additions & 3 deletions tests/test_codebase/test_mmdet/test_mmdet_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
import torch

from mmdeploy.codebase import import_codebase
from mmdeploy.codebase.mmdet import (clip_bboxes, get_post_processing_params,
pad_with_value,
pad_with_value_if_necessary)
from mmdeploy.utils import Codebase

try:
import_codebase(Codebase.MMDET)
except ImportError:
pytest.skip(f'{Codebase.MMDET} is not installed.', allow_module_level=True)

from mmdeploy.codebase.mmdet import (clip_bboxes, get_post_processing_params,
pad_with_value,
pad_with_value_if_necessary)


def test_clip_bboxes():
x1 = torch.rand(3, 2) * 224
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import mmdeploy.backend.ncnn as ncnn_apis
import mmdeploy.backend.onnxruntime as ort_apis
from mmdeploy.codebase import import_codebase
from mmdeploy.codebase.mmdet.deploy.object_detection_model import End2EndModel
from mmdeploy.utils import Backend, Codebase
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker

Expand All @@ -19,6 +18,8 @@
except ImportError:
pytest.skip(f'{Codebase.MMDET} is not installed.', allow_module_level=True)

from mmdeploy.codebase.mmdet.deploy.object_detection_model import End2EndModel


def assert_det_results(results, module_name: str = 'model'):
assert results is not None, f'failed to get output using {module_name}'
Expand Down