2022-09-02 13:10:31 +08:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
from modelscope.pipelines import pipeline
|
|
|
|
|
from modelscope.utils.constant import Tasks
|
|
|
|
|
from modelscope.utils.test_utils import test_level
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TinynasObjectDetectionTest(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
|
|
|
|
|
def test_run(self):
|
|
|
|
|
tinynas_object_detection = pipeline(
|
|
|
|
|
Tasks.image_object_detection, model='damo/cv_tinynas_detection')
|
|
|
|
|
result = tinynas_object_detection(
|
|
|
|
|
'data/test/images/image_detection.jpg')
|
|
|
|
|
print(result)
|
|
|
|
|
|
2022-09-09 14:56:15 +08:00
|
|
|
@unittest.skip('demo compatibility test is only enabled on a needed-basis')
|
2022-09-08 14:08:51 +08:00
|
|
|
def test_demo_compatibility(self):
|
|
|
|
|
self.test_demo()
|
|
|
|
|
|
2022-09-02 13:10:31 +08:00
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
unittest.main()
|