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_cmdssl_video_embedding.py 863 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. # !/usr/bin/env python
  3. import os.path as osp
  4. import shutil
  5. import tempfile
  6. import unittest
  7. import cv2
  8. from modelscope.fileio import File
  9. from modelscope.msdatasets import MsDataset
  10. from modelscope.pipelines import pipeline
  11. from modelscope.utils.constant import ModelFile, Tasks
  12. from modelscope.utils.test_utils import test_level
  13. class CMDSSLVideoEmbeddingTest(unittest.TestCase):
  14. @unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
  15. def test_run_modelhub(self):
  16. videossl_pipeline = pipeline(
  17. Tasks.video_embedding, model='damo/cv_r2p1d_video_embedding')
  18. result = videossl_pipeline(
  19. 'data/test/videos/action_recognition_test_video.mp4')
  20. print(f'video embedding output: {result}.')
  21. if __name__ == '__main__':
  22. unittest.main()