Files
modelscope/tests/pipelines/test_hand_detection.py

30 lines
910 B
Python
Raw Permalink Normal View History

# Copyright (c) Alibaba, Inc. and its affiliates.
import unittest
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.utils.test_utils import test_level
2023-05-22 10:53:18 +08:00
class ObjectDetectionTest(unittest.TestCase):
def setUp(self) -> None:
self.task = Tasks.domain_specific_object_detection
self.model_id = 'damo/cv_yolox-pai_hand-detection'
2023-05-22 10:53:18 +08:00
@unittest.skip('skip test in current test level: no pipeline implemented')
def test_hand_detection_pipeline(self):
test_image = 'data/test/images/hand_detection.jpg'
hand_detection = pipeline(self.task, model=self.model_id)
result = hand_detection(test_image)
hand_detection.show_result(test_image, result,
'hand_detection_ret.jpg')
print(f'hand detection result={result}')
if __name__ == '__main__':
unittest.main()