Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import subprocess
|
2 |
import os
|
|
|
3 |
|
4 |
subprocess.run(["git", "clone", "https://github.com/fat-ai/MuseV.git"])
|
5 |
|
@@ -11,11 +12,19 @@ subprocess.run(["mim", "install", "mmcv>=2.0.1"])
|
|
11 |
subprocess.run(["mim", "install", "mmdet>=3.1.0"])
|
12 |
subprocess.run(["mim", "install", "mmpose>=1.1.0"])
|
13 |
subprocess.run(["git", "clone", "--recursive", "https://github.com/fat-ai/MuseV.git"])
|
14 |
-
|
15 |
|
|
|
16 |
command = "\"import sys; sys.path.append('./MuseV/MuseV'); sys.path.append('./MuseV/MuseV/MMCM'); sys.path.append('./MuseV/MuseV/diffusers/src'); sys.path.append('./MuseV/MuseV/controlnet_aux/src')\""
|
17 |
subprocess.run(["python","-c",command])
|
|
|
18 |
|
19 |
-
|
20 |
-
subprocess.run(["
|
|
|
|
|
|
|
|
|
|
|
21 |
|
|
|
|
1 |
import subprocess
|
2 |
import os
|
3 |
+
import gradio as gr
|
4 |
|
5 |
subprocess.run(["git", "clone", "https://github.com/fat-ai/MuseV.git"])
|
6 |
|
|
|
12 |
subprocess.run(["mim", "install", "mmdet>=3.1.0"])
|
13 |
subprocess.run(["mim", "install", "mmpose>=1.1.0"])
|
14 |
subprocess.run(["git", "clone", "--recursive", "https://github.com/fat-ai/MuseV.git"])
|
15 |
+
subprocess.run(["git", "clone", "https://huggingface.co/TMElyralab/MuseV", "./checkpoints"])
|
16 |
|
17 |
+
os.chdir("..")
|
18 |
command = "\"import sys; sys.path.append('./MuseV/MuseV'); sys.path.append('./MuseV/MuseV/MMCM'); sys.path.append('./MuseV/MuseV/diffusers/src'); sys.path.append('./MuseV/MuseV/controlnet_aux/src')\""
|
19 |
subprocess.run(["python","-c",command])
|
20 |
+
subprocess.run(["mv", "./MuseV/scripts/inference/text2video.py", "./MuseV/text2video.py"])
|
21 |
|
22 |
+
def run():
|
23 |
+
subprocess.run(["python", "./MuseV/text2video.py", "--sd_model_name majicmixRealv6Fp16", "--unet_model_name", "musev_referencenet", "--referencenet_model_name", "musev_referencenet", "--ip_adapter_model_name", "musev_referencenet", "-test_data_path", "./configs/tasks/example.yaml", "--output_dir", "./output", "--n_batch", "1", "--target_datas", "Mona_Lisa", "--vision_clip_extractor_class_name", "ImageClipVisionFeatureExtractor", "--vision_clip_model_path", "./checkpoints/IP-Adapter/models/image_encoder", "--motion_speed", "5.0", "--time_size", "120", "--fps", "24"])
|
24 |
+
|
25 |
+
with gr.Blocks() as demo:
|
26 |
+
button = gr.Button()
|
27 |
+
video = gr.Video()
|
28 |
+
button.click(fn=run,outputs=video)
|
29 |
|
30 |
+
demo.launch(share=True)
|