Files
modelscope/tests/pipelines/test_hicossl_video_embedding.py

33 lines
1.0 KiB
Python
Raw Normal View History

# Copyright (c) Alibaba, Inc. and its affiliates.
# !/usr/bin/env python
import unittest
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.utils.demo_utils import DemoCompatibilityCheck
from modelscope.utils.test_utils import test_level
class HICOSSLVideoEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck):
def setUp(self) -> None:
self.task = Tasks.video_embedding
self.model_id = 'damo/cv_s3dg_video-embedding'
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
def test_run_modelhub(self):
videossl_pipeline = pipeline(
Tasks.video_embedding, model=self.model_id)
result = videossl_pipeline(
'data/test/videos/action_recognition_test_video.mp4')
print(f'video embedding output: {result}.')
@unittest.skipUnless(test_level() >= 2, 'skip test in current test level')
def test_demo_compatibility(self):
self.compatibility_check()
if __name__ == '__main__':
unittest.main()