mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-19 01:29:24 +01:00
31 lines
863 B
Python
31 lines
863 B
Python
|
|
# Copyright (c) Alibaba, Inc. and its affiliates.
|
||
|
|
# !/usr/bin/env python
|
||
|
|
import os.path as osp
|
||
|
|
import shutil
|
||
|
|
import tempfile
|
||
|
|
import unittest
|
||
|
|
|
||
|
|
import cv2
|
||
|
|
|
||
|
|
from modelscope.fileio import File
|
||
|
|
from modelscope.msdatasets import MsDataset
|
||
|
|
from modelscope.pipelines import pipeline
|
||
|
|
from modelscope.utils.constant import ModelFile, Tasks
|
||
|
|
from modelscope.utils.test_utils import test_level
|
||
|
|
|
||
|
|
|
||
|
|
class CMDSSLVideoEmbeddingTest(unittest.TestCase):
|
||
|
|
|
||
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
|
||
|
|
def test_run_modelhub(self):
|
||
|
|
videossl_pipeline = pipeline(
|
||
|
|
Tasks.video_embedding, model='damo/cv_r2p1d_video_embedding')
|
||
|
|
result = videossl_pipeline(
|
||
|
|
'data/test/videos/action_recognition_test_video.mp4')
|
||
|
|
|
||
|
|
print(f'video embedding output: {result}.')
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
unittest.main()
|