Spaces:
Running
on
A10G
Running
on
A10G
anchor
commited on
Commit
•
e347d21
1
Parent(s):
059d381
Update app.py
Browse files
app.py
CHANGED
@@ -22,19 +22,10 @@ import pickle
|
|
22 |
from tqdm import tqdm
|
23 |
import copy
|
24 |
from argparse import Namespace
|
25 |
-
|
26 |
-
from musetalk.utils.utils import get_file_type,get_video_fps,datagen
|
27 |
-
from musetalk.utils.preprocessing import get_landmark_and_bbox,read_imgs,coord_placeholder
|
28 |
-
from musetalk.utils.blending import get_image
|
29 |
-
from musetalk.utils.utils import load_all_model
|
30 |
import shutil
|
31 |
import gdown
|
32 |
|
33 |
|
34 |
-
|
35 |
-
ProjectDir = os.path.abspath(os.path.dirname(__file__))
|
36 |
-
CheckpointsDir = os.path.join(ProjectDir, "checkpoints")
|
37 |
-
|
38 |
def download_model():
|
39 |
if not os.path.exists(CheckpointsDir):
|
40 |
os.makedirs(CheckpointsDir)
|
@@ -98,6 +89,22 @@ def download_model():
|
|
98 |
else:
|
99 |
print("Already download the model.")
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
@spaces.GPU(duration=600)
|
102 |
@torch.no_grad()
|
103 |
def inference(audio_path,video_path,bbox_shift,progress=gr.Progress(track_tqdm=True)):
|
@@ -203,7 +210,6 @@ def inference(audio_path,video_path,bbox_shift,progress=gr.Progress(track_tqdm=T
|
|
203 |
print(f"result is save to {output_vid_name}")
|
204 |
return output_vid_name
|
205 |
|
206 |
-
download_model() # for huggingface deployment.
|
207 |
|
208 |
|
209 |
# load model weights
|
|
|
22 |
from tqdm import tqdm
|
23 |
import copy
|
24 |
from argparse import Namespace
|
|
|
|
|
|
|
|
|
|
|
25 |
import shutil
|
26 |
import gdown
|
27 |
|
28 |
|
|
|
|
|
|
|
|
|
29 |
def download_model():
|
30 |
if not os.path.exists(CheckpointsDir):
|
31 |
os.makedirs(CheckpointsDir)
|
|
|
89 |
else:
|
90 |
print("Already download the model.")
|
91 |
|
92 |
+
|
93 |
+
|
94 |
+
download_model() # for huggingface deployment.
|
95 |
+
|
96 |
+
|
97 |
+
from musetalk.utils.utils import get_file_type,get_video_fps,datagen
|
98 |
+
from musetalk.utils.preprocessing import get_landmark_and_bbox,read_imgs,coord_placeholder
|
99 |
+
from musetalk.utils.blending import get_image
|
100 |
+
from musetalk.utils.utils import load_all_model
|
101 |
+
|
102 |
+
|
103 |
+
|
104 |
+
ProjectDir = os.path.abspath(os.path.dirname(__file__))
|
105 |
+
CheckpointsDir = os.path.join(ProjectDir, "checkpoints")
|
106 |
+
|
107 |
+
|
108 |
@spaces.GPU(duration=600)
|
109 |
@torch.no_grad()
|
110 |
def inference(audio_path,video_path,bbox_shift,progress=gr.Progress(track_tqdm=True)):
|
|
|
210 |
print(f"result is save to {output_vid_name}")
|
211 |
return output_vid_name
|
212 |
|
|
|
213 |
|
214 |
|
215 |
# load model weights
|