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_hicossl_video_embedding.py 1.1 kB

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. # !/usr/bin/env python
  3. import unittest
  4. from modelscope.pipelines import pipeline
  5. from modelscope.utils.constant import Tasks
  6. from modelscope.utils.demo_utils import DemoCompatibilityCheck
  7. from modelscope.utils.test_utils import test_level
  8. class HICOSSLVideoEmbeddingTest(unittest.TestCase, DemoCompatibilityCheck):
  9. def setUp(self) -> None:
  10. self.task = Tasks.video_embedding
  11. self.model_id = 'damo/cv_s3dg_video-embedding'
  12. @unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
  13. def test_run_modelhub(self):
  14. videossl_pipeline = pipeline(
  15. Tasks.video_embedding, model=self.model_id)
  16. result = videossl_pipeline(
  17. 'data/test/videos/action_recognition_test_video.mp4')
  18. print(f'video embedding output: {result}.')
  19. @unittest.skip('demo compatibility test is only enabled on a needed-basis')
  20. def test_demo_compatibility(self):
  21. self.compatibility_check()
  22. if __name__ == '__main__':
  23. unittest.main()