|
@@ -19,20 +19,14 @@ class ObjectDetectionTest(unittest.TestCase, DemoCompatibilityCheck): |
|
|
model_id = 'damo/cv_vit_object-detection_coco' |
|
|
model_id = 'damo/cv_vit_object-detection_coco' |
|
|
object_detect = pipeline(Tasks.image_object_detection, model=model_id) |
|
|
object_detect = pipeline(Tasks.image_object_detection, model=model_id) |
|
|
result = object_detect(input_location) |
|
|
result = object_detect(input_location) |
|
|
if result: |
|
|
|
|
|
print(result) |
|
|
|
|
|
else: |
|
|
|
|
|
raise ValueError('process error') |
|
|
|
|
|
|
|
|
print(result) |
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 2, 'skip test in current test level') |
|
|
@unittest.skipUnless(test_level() >= 2, 'skip test in current test level') |
|
|
def test_object_detection_with_default_task(self): |
|
|
def test_object_detection_with_default_task(self): |
|
|
input_location = 'data/test/images/image_detection.jpg' |
|
|
input_location = 'data/test/images/image_detection.jpg' |
|
|
object_detect = pipeline(Tasks.image_object_detection) |
|
|
object_detect = pipeline(Tasks.image_object_detection) |
|
|
result = object_detect(input_location) |
|
|
result = object_detect(input_location) |
|
|
if result: |
|
|
|
|
|
print(result) |
|
|
|
|
|
else: |
|
|
|
|
|
raise ValueError('process error') |
|
|
|
|
|
|
|
|
print(result) |
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level') |
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level') |
|
|
def test_human_detection(self): |
|
|
def test_human_detection(self): |
|
@@ -40,20 +34,14 @@ class ObjectDetectionTest(unittest.TestCase, DemoCompatibilityCheck): |
|
|
model_id = 'damo/cv_resnet18_human-detection' |
|
|
model_id = 'damo/cv_resnet18_human-detection' |
|
|
human_detect = pipeline(Tasks.human_detection, model=model_id) |
|
|
human_detect = pipeline(Tasks.human_detection, model=model_id) |
|
|
result = human_detect(input_location) |
|
|
result = human_detect(input_location) |
|
|
if result: |
|
|
|
|
|
print(result) |
|
|
|
|
|
else: |
|
|
|
|
|
raise ValueError('process error') |
|
|
|
|
|
|
|
|
print(result) |
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 2, 'skip test in current test level') |
|
|
@unittest.skipUnless(test_level() >= 2, 'skip test in current test level') |
|
|
def test_human_detection_with_default_task(self): |
|
|
def test_human_detection_with_default_task(self): |
|
|
input_location = 'data/test/images/image_detection.jpg' |
|
|
input_location = 'data/test/images/image_detection.jpg' |
|
|
human_detect = pipeline(Tasks.human_detection) |
|
|
human_detect = pipeline(Tasks.human_detection) |
|
|
result = human_detect(input_location) |
|
|
result = human_detect(input_location) |
|
|
if result: |
|
|
|
|
|
print(result) |
|
|
|
|
|
else: |
|
|
|
|
|
raise ValueError('process error') |
|
|
|
|
|
|
|
|
print(result) |
|
|
|
|
|
|
|
|
@unittest.skip('demo compatibility test is only enabled on a needed-basis') |
|
|
@unittest.skip('demo compatibility test is only enabled on a needed-basis') |
|
|
def test_demo_compatibility(self): |
|
|
def test_demo_compatibility(self): |
|
|