mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
Fix: skip tests for uninstalled codebases (#987)
* skip tests if codebase not installed * skip ort run test * fix mmseg
This commit is contained in:
parent
9918d29212
commit
966d737a1b
@ -38,8 +38,7 @@ onnxruntime:
|
|||||||
|
|
||||||
pipeline_ort_dynamic_fp32: &pipeline_ort_dynamic_fp32
|
pipeline_ort_dynamic_fp32: &pipeline_ort_dynamic_fp32
|
||||||
convert_image: *convert_image
|
convert_image: *convert_image
|
||||||
backend_test: *default_backend_test
|
backend_test: False
|
||||||
sdk_config: *sdk_dynamic
|
|
||||||
deploy_config: configs/mmcls/classification_onnxruntime_dynamic.py
|
deploy_config: configs/mmcls/classification_onnxruntime_dynamic.py
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,8 +37,7 @@ globals:
|
|||||||
onnxruntime:
|
onnxruntime:
|
||||||
pipeline_ort_static_fp32: &pipeline_ort_static_fp32
|
pipeline_ort_static_fp32: &pipeline_ort_static_fp32
|
||||||
convert_image: *convert_image
|
convert_image: *convert_image
|
||||||
backend_test: *default_backend_test
|
backend_test: False
|
||||||
sdk_config: *sdk_dynamic
|
|
||||||
deploy_config: configs/mmdet/detection/detection_onnxruntime_static.py
|
deploy_config: configs/mmdet/detection/detection_onnxruntime_static.py
|
||||||
|
|
||||||
pipeline_ort_dynamic_fp32: &pipeline_ort_dynamic_fp32
|
pipeline_ort_dynamic_fp32: &pipeline_ort_dynamic_fp32
|
||||||
@ -168,13 +167,13 @@ pplnn:
|
|||||||
torchscript:
|
torchscript:
|
||||||
pipeline_ts_fp32: &pipeline_ts_fp32
|
pipeline_ts_fp32: &pipeline_ts_fp32
|
||||||
convert_image: *convert_image
|
convert_image: *convert_image
|
||||||
backend_test: False
|
backend_test: *default_backend_test
|
||||||
deploy_config: configs/mmdet/detection/detection_torchscript.py
|
deploy_config: configs/mmdet/detection/detection_torchscript.py
|
||||||
|
|
||||||
# ============= seg ================
|
# ============= seg ================
|
||||||
pipeline_seg_ts_fp32: &pipeline_seg_ts_fp32
|
pipeline_seg_ts_fp32: &pipeline_seg_ts_fp32
|
||||||
convert_image: *convert_image
|
convert_image: *convert_image
|
||||||
backend_test: False
|
backend_test: *default_backend_test
|
||||||
deploy_config: configs/mmdet/instance-seg/instance-seg_torchscript.py
|
deploy_config: configs/mmdet/instance-seg/instance-seg_torchscript.py
|
||||||
|
|
||||||
models:
|
models:
|
||||||
@ -206,6 +205,7 @@ models:
|
|||||||
- deploy_config: configs/mmdet/detection/detection_tensorrt-fp16_dynamic-300x300-512x512.py
|
- deploy_config: configs/mmdet/detection/detection_tensorrt-fp16_dynamic-300x300-512x512.py
|
||||||
convert_image: *convert_image
|
convert_image: *convert_image
|
||||||
backend_test: *default_backend_test
|
backend_test: *default_backend_test
|
||||||
|
sdk_config: *sdk_dynamic
|
||||||
- deploy_config: configs/mmdet/detection/single-stage_ncnn_static-300x300.py
|
- deploy_config: configs/mmdet/detection/single-stage_ncnn_static-300x300.py
|
||||||
convert_image: *convert_image
|
convert_image: *convert_image
|
||||||
backend_test: False
|
backend_test: False
|
||||||
|
@ -27,8 +27,6 @@ globals:
|
|||||||
onnxruntime:
|
onnxruntime:
|
||||||
pipeline_ort_static_fp32: &pipeline_ort_static_fp32
|
pipeline_ort_static_fp32: &pipeline_ort_static_fp32
|
||||||
convert_image: *convert_image
|
convert_image: *convert_image
|
||||||
backend_test: *default_backend_test
|
|
||||||
sdk_config: *sdk_dynamic
|
|
||||||
deploy_config: configs/mmedit/super-resolution/super-resolution_onnxruntime_static.py
|
deploy_config: configs/mmedit/super-resolution/super-resolution_onnxruntime_static.py
|
||||||
|
|
||||||
pipeline_ort_dynamic_fp32: &pipeline_ort_dynamic_fp32
|
pipeline_ort_dynamic_fp32: &pipeline_ort_dynamic_fp32
|
||||||
|
@ -34,8 +34,6 @@ onnxruntime:
|
|||||||
# ======= detection =======
|
# ======= detection =======
|
||||||
pipeline_ort_detection_static_fp32: &pipeline_ort_detection_static_fp32
|
pipeline_ort_detection_static_fp32: &pipeline_ort_detection_static_fp32
|
||||||
convert_image: *convert_image_det
|
convert_image: *convert_image_det
|
||||||
backend_test: *default_backend_test
|
|
||||||
sdk_config: *sdk_detection_dynamic
|
|
||||||
deploy_config: configs/mmocr/text-detection/text-detection_onnxruntime_static.py
|
deploy_config: configs/mmocr/text-detection/text-detection_onnxruntime_static.py
|
||||||
|
|
||||||
pipeline_ort_detection_dynamic_fp32: &pipeline_ort_detection_dynamic_fp32
|
pipeline_ort_detection_dynamic_fp32: &pipeline_ort_detection_dynamic_fp32
|
||||||
|
@ -14,7 +14,7 @@ globals:
|
|||||||
convert_image_det: &convert_image_det
|
convert_image_det: &convert_image_det
|
||||||
input_img: *img_demo
|
input_img: *img_demo
|
||||||
test_img: *img_dota_demo
|
test_img: *img_dota_demo
|
||||||
backend_test: &default_backend_test True
|
backend_test: &default_backend_test False
|
||||||
|
|
||||||
onnxruntime:
|
onnxruntime:
|
||||||
# ======= detection =======
|
# ======= detection =======
|
||||||
|
@ -15,7 +15,10 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Codebase, load_config
|
from mmdeploy.utils import Codebase, load_config
|
||||||
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
||||||
|
|
||||||
import_codebase(Codebase.MMCLS)
|
try:
|
||||||
|
import_codebase(Codebase.MMCLS)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMCLS} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
model_cfg_path = 'tests/test_codebase/test_mmcls/data/model.py'
|
model_cfg_path = 'tests/test_codebase/test_mmcls/data/model.py'
|
||||||
model_cfg = load_config(model_cfg_path)[0]
|
model_cfg = load_config(model_cfg_path)[0]
|
||||||
|
@ -15,7 +15,10 @@ from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
|||||||
NUM_CLASS = 1000
|
NUM_CLASS = 1000
|
||||||
IMAGE_SIZE = 64
|
IMAGE_SIZE = 64
|
||||||
|
|
||||||
import_codebase(Codebase.MMCLS)
|
try:
|
||||||
|
import_codebase(Codebase.MMCLS)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMCLS} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
@backend_checker(Backend.ONNXRUNTIME)
|
@backend_checker(Backend.ONNXRUNTIME)
|
||||||
|
@ -9,7 +9,10 @@ from mmdeploy.core import RewriterContext
|
|||||||
from mmdeploy.utils import Backend, Codebase
|
from mmdeploy.utils import Backend, Codebase
|
||||||
from mmdeploy.utils.test import WrapModel, check_backend, get_rewrite_outputs
|
from mmdeploy.utils.test import WrapModel, check_backend, get_rewrite_outputs
|
||||||
|
|
||||||
import_codebase(Codebase.MMCLS)
|
try:
|
||||||
|
import_codebase(Codebase.MMCLS)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMCLS} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
input = torch.rand(1)
|
input = torch.rand(1)
|
||||||
|
|
||||||
|
@ -13,7 +13,10 @@ from mmdeploy.utils.test import (WrapFunction, WrapModel, backend_checker,
|
|||||||
check_backend, get_onnx_model,
|
check_backend, get_onnx_model,
|
||||||
get_rewrite_outputs)
|
get_rewrite_outputs)
|
||||||
|
|
||||||
import_codebase(Codebase.MMDET)
|
try:
|
||||||
|
import_codebase(Codebase.MMDET)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMDET} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
@backend_checker(Backend.TENSORRT)
|
@backend_checker(Backend.TENSORRT)
|
||||||
|
@ -15,7 +15,10 @@ from mmdeploy.utils.config_utils import get_ir_config
|
|||||||
from mmdeploy.utils.test import (WrapModel, check_backend, get_model_outputs,
|
from mmdeploy.utils.test import (WrapModel, check_backend, get_model_outputs,
|
||||||
get_rewrite_outputs)
|
get_rewrite_outputs)
|
||||||
|
|
||||||
import_codebase(Codebase.MMDET)
|
try:
|
||||||
|
import_codebase(Codebase.MMDET)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMDET} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
def seed_everything(seed=1029):
|
def seed_everything(seed=1029):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Copyright (c) OpenMMLab. All rights reserved.
|
# Copyright (c) OpenMMLab. All rights reserved.
|
||||||
import mmcv
|
import mmcv
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from mmdeploy.codebase import import_codebase
|
from mmdeploy.codebase import import_codebase
|
||||||
@ -9,7 +10,10 @@ from mmdeploy.codebase.mmdet import (clip_bboxes, get_post_processing_params,
|
|||||||
pad_with_value_if_necessary)
|
pad_with_value_if_necessary)
|
||||||
from mmdeploy.utils import Codebase
|
from mmdeploy.utils import Codebase
|
||||||
|
|
||||||
import_codebase(Codebase.MMDET)
|
try:
|
||||||
|
import_codebase(Codebase.MMDET)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMDET} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
def test_clip_bboxes():
|
def test_clip_bboxes():
|
||||||
|
@ -17,7 +17,10 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Codebase, load_config
|
from mmdeploy.utils import Codebase, load_config
|
||||||
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
||||||
|
|
||||||
import_codebase(Codebase.MMDET)
|
try:
|
||||||
|
import_codebase(Codebase.MMDET)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMDET} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
model_cfg_path = 'tests/test_codebase/test_mmdet/data/model.py'
|
model_cfg_path = 'tests/test_codebase/test_mmdet/data/model.py'
|
||||||
model_cfg = load_config(model_cfg_path)[0]
|
model_cfg = load_config(model_cfg_path)[0]
|
||||||
|
@ -14,7 +14,10 @@ from mmdeploy.codebase.mmdet.deploy.object_detection_model import End2EndModel
|
|||||||
from mmdeploy.utils import Backend, Codebase
|
from mmdeploy.utils import Backend, Codebase
|
||||||
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
||||||
|
|
||||||
import_codebase(Codebase.MMDET)
|
try:
|
||||||
|
import_codebase(Codebase.MMDET)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMDET} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
def assert_det_results(results, module_name: str = 'model'):
|
def assert_det_results(results, module_name: str = 'model'):
|
||||||
|
@ -5,14 +5,18 @@ from typing import Dict
|
|||||||
|
|
||||||
import mmcv
|
import mmcv
|
||||||
import onnx
|
import onnx
|
||||||
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
from mmedit.models.backbones.sr_backbones import SRCNN
|
|
||||||
|
|
||||||
from mmdeploy.codebase import import_codebase
|
from mmdeploy.codebase import import_codebase
|
||||||
from mmdeploy.core import RewriterContext
|
from mmdeploy.core import RewriterContext
|
||||||
from mmdeploy.utils import Backend, Codebase, get_onnx_config
|
from mmdeploy.utils import Backend, Codebase, get_onnx_config
|
||||||
|
|
||||||
import_codebase(Codebase.MMEDIT)
|
try:
|
||||||
|
import_codebase(Codebase.MMEDIT)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(
|
||||||
|
f'{Codebase.MMEDIT} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
img = torch.rand(1, 3, 4, 4)
|
img = torch.rand(1, 3, 4, 4)
|
||||||
model_file = tempfile.NamedTemporaryFile(suffix='.onnx').name
|
model_file = tempfile.NamedTemporaryFile(suffix='.onnx').name
|
||||||
@ -46,6 +50,7 @@ deploy_cfg = mmcv.Config(
|
|||||||
|
|
||||||
|
|
||||||
def test_srcnn():
|
def test_srcnn():
|
||||||
|
from mmedit.models.backbones.sr_backbones import SRCNN
|
||||||
pytorch_model = SRCNN()
|
pytorch_model = SRCNN()
|
||||||
model_inputs = {'x': img}
|
model_inputs = {'x': img}
|
||||||
|
|
||||||
|
@ -14,7 +14,11 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Codebase, load_config
|
from mmdeploy.utils import Codebase, load_config
|
||||||
from mmdeploy.utils.test import SwitchBackendWrapper
|
from mmdeploy.utils.test import SwitchBackendWrapper
|
||||||
|
|
||||||
import_codebase(Codebase.MMEDIT)
|
try:
|
||||||
|
import_codebase(Codebase.MMEDIT)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(
|
||||||
|
f'{Codebase.MMEDIT} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
model_cfg = 'tests/test_codebase/test_mmedit/data/model.py'
|
model_cfg = 'tests/test_codebase/test_mmedit/data/model.py'
|
||||||
model_cfg = load_config(model_cfg)[0]
|
model_cfg = load_config(model_cfg)[0]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Copyright (c) OpenMMLab. All rights reserved.
|
# Copyright (c) OpenMMLab. All rights reserved.
|
||||||
import mmcv
|
import mmcv
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
import mmdeploy.backend.onnxruntime as ort_apis
|
import mmdeploy.backend.onnxruntime as ort_apis
|
||||||
@ -8,7 +9,11 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Backend, Codebase, load_config
|
from mmdeploy.utils import Backend, Codebase, load_config
|
||||||
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
||||||
|
|
||||||
import_codebase(Codebase.MMEDIT)
|
try:
|
||||||
|
import_codebase(Codebase.MMEDIT)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(
|
||||||
|
f'{Codebase.MMEDIT} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
@backend_checker(Backend.ONNXRUNTIME)
|
@backend_checker(Backend.ONNXRUNTIME)
|
||||||
|
@ -5,7 +5,6 @@ import mmcv
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
from mmocr.models.textdet.necks import FPNC
|
|
||||||
|
|
||||||
from mmdeploy.codebase import import_codebase
|
from mmdeploy.codebase import import_codebase
|
||||||
from mmdeploy.core import RewriterContext, patch_model
|
from mmdeploy.core import RewriterContext, patch_model
|
||||||
@ -13,7 +12,12 @@ from mmdeploy.utils import Backend, Codebase
|
|||||||
from mmdeploy.utils.test import (WrapModel, check_backend, get_model_outputs,
|
from mmdeploy.utils.test import (WrapModel, check_backend, get_model_outputs,
|
||||||
get_rewrite_outputs)
|
get_rewrite_outputs)
|
||||||
|
|
||||||
import_codebase(Codebase.MMOCR)
|
try:
|
||||||
|
import_codebase(Codebase.MMOCR)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMOCR} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
|
from mmocr.models.textdet.necks import FPNC
|
||||||
|
|
||||||
|
|
||||||
class FPNCNeckModel(FPNC):
|
class FPNCNeckModel(FPNC):
|
||||||
|
@ -14,7 +14,10 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Codebase, load_config
|
from mmdeploy.utils import Codebase, load_config
|
||||||
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
||||||
|
|
||||||
import_codebase(Codebase.MMOCR)
|
try:
|
||||||
|
import_codebase(Codebase.MMOCR)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMOCR} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
model_cfg_path = 'tests/test_codebase/test_mmocr/data/dbnet.py'
|
model_cfg_path = 'tests/test_codebase/test_mmocr/data/dbnet.py'
|
||||||
model_cfg = load_config(model_cfg_path)[0]
|
model_cfg = load_config(model_cfg_path)[0]
|
||||||
|
@ -12,7 +12,10 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Backend, Codebase, load_config
|
from mmdeploy.utils import Backend, Codebase, load_config
|
||||||
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
||||||
|
|
||||||
import_codebase(Codebase.MMOCR)
|
try:
|
||||||
|
import_codebase(Codebase.MMOCR)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMOCR} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
IMAGE_SIZE = 32
|
IMAGE_SIZE = 32
|
||||||
|
|
||||||
|
@ -14,7 +14,10 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Codebase, load_config
|
from mmdeploy.utils import Codebase, load_config
|
||||||
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
||||||
|
|
||||||
import_codebase(Codebase.MMOCR)
|
try:
|
||||||
|
import_codebase(Codebase.MMOCR)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMOCR} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
model_cfg_path = 'tests/test_codebase/test_mmocr/data/crnn.py'
|
model_cfg_path = 'tests/test_codebase/test_mmocr/data/crnn.py'
|
||||||
model_cfg = load_config(model_cfg_path)[0]
|
model_cfg = load_config(model_cfg_path)[0]
|
||||||
|
@ -12,7 +12,10 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Backend, Codebase, load_config
|
from mmdeploy.utils import Backend, Codebase, load_config
|
||||||
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
||||||
|
|
||||||
import_codebase(Codebase.MMOCR)
|
try:
|
||||||
|
import_codebase(Codebase.MMOCR)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMOCR} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
IMAGE_SIZE = 32
|
IMAGE_SIZE = 32
|
||||||
|
|
||||||
|
@ -5,15 +5,19 @@ import pytest
|
|||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
from mmcv import ConfigDict
|
from mmcv import ConfigDict
|
||||||
from mmseg.models import BACKBONES, HEADS
|
|
||||||
from mmseg.models.decode_heads.decode_head import BaseDecodeHead
|
|
||||||
|
|
||||||
from mmdeploy.codebase import import_codebase
|
from mmdeploy.codebase import import_codebase
|
||||||
from mmdeploy.utils import Backend, Codebase, Task
|
from mmdeploy.utils import Backend, Codebase, Task
|
||||||
from mmdeploy.utils.test import (WrapModel, check_backend, get_model_outputs,
|
from mmdeploy.utils.test import (WrapModel, check_backend, get_model_outputs,
|
||||||
get_rewrite_outputs)
|
get_rewrite_outputs)
|
||||||
|
|
||||||
import_codebase(Codebase.MMSEG)
|
try:
|
||||||
|
import_codebase(Codebase.MMSEG)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMSEG} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
|
from mmseg.models import BACKBONES, HEADS
|
||||||
|
from mmseg.models.decode_heads.decode_head import BaseDecodeHead
|
||||||
|
|
||||||
|
|
||||||
@BACKBONES.register_module()
|
@BACKBONES.register_module()
|
||||||
|
@ -16,7 +16,10 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Codebase, load_config
|
from mmdeploy.utils import Codebase, load_config
|
||||||
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
from mmdeploy.utils.test import DummyModel, SwitchBackendWrapper
|
||||||
|
|
||||||
import_codebase(Codebase.MMSEG)
|
try:
|
||||||
|
import_codebase(Codebase.MMSEG)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMSEG} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
model_cfg_path = 'tests/test_codebase/test_mmseg/data/model.py'
|
model_cfg_path = 'tests/test_codebase/test_mmseg/data/model.py'
|
||||||
model_cfg = load_config(model_cfg_path)[0]
|
model_cfg = load_config(model_cfg_path)[0]
|
||||||
|
@ -12,7 +12,10 @@ from mmdeploy.codebase import import_codebase
|
|||||||
from mmdeploy.utils import Backend, Codebase
|
from mmdeploy.utils import Backend, Codebase
|
||||||
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
from mmdeploy.utils.test import SwitchBackendWrapper, backend_checker
|
||||||
|
|
||||||
import_codebase(Codebase.MMSEG)
|
try:
|
||||||
|
import_codebase(Codebase.MMSEG)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip(f'{Codebase.MMSEG} is not installed.', allow_module_level=True)
|
||||||
|
|
||||||
NUM_CLASS = 19
|
NUM_CLASS = 19
|
||||||
IMAGE_SIZE = 32
|
IMAGE_SIZE = 32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user