Libra7578 commited on
Commit
554b2b1
1 Parent(s): 85128fb

![33169A8C-8B52-4BE8-815F-7A7EABFC6F20.png](https://s3.amazonaws.com/moonup/production/uploads/63f6369db29015adc33b1f63/-QEDE9hDMaNpYNGCc4uoa.png)

Files changed (1) hide show
  1. Im2vid +17 -0
Im2vid ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import snapshot_download
2
+
3
+ from modelscope.pipelines import pipeline
4
+ from modelscope.outputs import OutputKeys
5
+ import pathlib
6
+
7
+ model_dir = pathlib.Path('weights')
8
+ snapshot_download('damo-vilab/modelscope-damo-text-to-video-synthesis',
9
+ repo_type='model', local_dir=model_dir)
10
+
11
+ pipe = pipeline('text-to-video-synthesis', model_dir.as_posix())
12
+ test_text = {
13
+ 'text': 'A panda eating bamboo on a rock.',
14
+ }
15
+ output_video_path = pipe(test_text,)[OutputKeys.OUTPUT_VIDEO]
16
+ print('output_video_path:', output_video_path)
17
+