|
@@ -18,7 +18,7 @@ class ImageInstanceSegmentationTest(unittest.TestCase): |
|
|
model_id = 'damo/cv_swin-b_image-instance-segmentation_coco' |
|
|
model_id = 'damo/cv_swin-b_image-instance-segmentation_coco' |
|
|
image = 'data/test/images/image_instance_segmentation.jpg' |
|
|
image = 'data/test/images/image_instance_segmentation.jpg' |
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level') |
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 2, 'skip test in current test level') |
|
|
def test_run_with_model_from_modelhub(self): |
|
|
def test_run_with_model_from_modelhub(self): |
|
|
model = Model.from_pretrained(self.model_id) |
|
|
model = Model.from_pretrained(self.model_id) |
|
|
config_path = os.path.join(model.model_dir, ModelFile.CONFIGURATION) |
|
|
config_path = os.path.join(model.model_dir, ModelFile.CONFIGURATION) |
|
@@ -30,7 +30,7 @@ class ImageInstanceSegmentationTest(unittest.TestCase): |
|
|
preprocessor=preprocessor) |
|
|
preprocessor=preprocessor) |
|
|
print(pipeline_ins(input=self.image)[OutputKeys.LABELS]) |
|
|
print(pipeline_ins(input=self.image)[OutputKeys.LABELS]) |
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 1, 'skip test in current test level') |
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 2, 'skip test in current test level') |
|
|
def test_run_with_model_name(self): |
|
|
def test_run_with_model_name(self): |
|
|
pipeline_ins = pipeline( |
|
|
pipeline_ins = pipeline( |
|
|
task=Tasks.image_segmentation, model=self.model_id) |
|
|
task=Tasks.image_segmentation, model=self.model_id) |
|
|