2022-06-28 14:04:40 +08:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
from modelscope.pipelines import pipeline
|
|
|
|
|
from modelscope.utils.constant import Tasks
|
|
|
|
|
from modelscope.utils.test_utils import test_level
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MultiModalFeatureTest(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
@unittest.skipUnless(test_level() >= 1, 'skip test in current test level')
|
|
|
|
|
def test_run(self):
|
|
|
|
|
animal_recog = pipeline(
|
|
|
|
|
Tasks.image_classification,
|
2022-06-30 17:46:31 +08:00
|
|
|
model='damo/cv_resnest101_animal_recognition')
|
2022-07-04 12:11:12 +08:00
|
|
|
result = animal_recog('data/test/images/dogs.jpg')
|
2022-06-28 14:04:40 +08:00
|
|
|
print(result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
unittest.main()
|