You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_tinynas_detection.py 797 B

1234567891011121314151617181920212223242526
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. import unittest
  3. from modelscope.pipelines import pipeline
  4. from modelscope.utils.constant import Tasks
  5. from modelscope.utils.test_utils import test_level
  6. class TinynasObjectDetectionTest(unittest.TestCase):
  7. @unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
  8. def test_run(self):
  9. tinynas_object_detection = pipeline(
  10. Tasks.image_object_detection, model='damo/cv_tinynas_detection')
  11. result = tinynas_object_detection(
  12. 'data/test/images/image_detection.jpg')
  13. print(result)
  14. @unittest.skip('demo compatibility test is only enabled on a needed-basis')
  15. def test_demo_compatibility(self):
  16. self.test_demo()
  17. if __name__ == '__main__':
  18. unittest.main()