Spaces:
Running
on
Zero
Running
on
Zero
xiaozhongji
commited on
Commit
·
2fc2052
1
Parent(s):
7498d59
update
Browse files
app.py
CHANGED
@@ -6,11 +6,10 @@ from pydub import AudioSegment
|
|
6 |
import hashlib
|
7 |
from sonic import Sonic
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
cmd = 'nvidia-smi'
|
14 |
os.system(cmd)
|
15 |
|
16 |
import torch
|
@@ -23,7 +22,6 @@ def get_md5(content):
|
|
23 |
md5 = md5hash.hexdigest()
|
24 |
return md5
|
25 |
|
26 |
-
@spaces.GPU
|
27 |
def get_video_res(img_path, audio_path, res_video_path, dynamic_scale=1.0):
|
28 |
|
29 |
expand_ratio = 0.5
|
@@ -45,6 +43,7 @@ res_path = './res_path/'
|
|
45 |
os.makedirs(tmp_path,exist_ok=1)
|
46 |
os.makedirs(res_path,exist_ok=1)
|
47 |
|
|
|
48 |
def process_sonic(image,audio,s0):
|
49 |
img_md5= get_md5(np.array(image))
|
50 |
audio_md5 = get_md5(audio[1])
|
|
|
6 |
import hashlib
|
7 |
from sonic import Sonic
|
8 |
|
9 |
+
cmd = 'python3 -m pip install "huggingface_hub[cli]"; \
|
10 |
+
huggingface-cli download LeonJoe13/Sonic --local-dir checkpoints; \
|
11 |
+
huggingface-cli download stabilityai/stable-video-diffusion-img2vid-xt --local-dir checkpoints/stable-video-diffusion-img2vid-xt; \
|
12 |
+
huggingface-cli download openai/whisper-tiny --local-dir checkpoints/whisper-tiny;'
|
|
|
13 |
os.system(cmd)
|
14 |
|
15 |
import torch
|
|
|
22 |
md5 = md5hash.hexdigest()
|
23 |
return md5
|
24 |
|
|
|
25 |
def get_video_res(img_path, audio_path, res_video_path, dynamic_scale=1.0):
|
26 |
|
27 |
expand_ratio = 0.5
|
|
|
43 |
os.makedirs(tmp_path,exist_ok=1)
|
44 |
os.makedirs(res_path,exist_ok=1)
|
45 |
|
46 |
+
@spaces.GPU
|
47 |
def process_sonic(image,audio,s0):
|
48 |
img_md5= get_md5(np.array(image))
|
49 |
audio_md5 = get_md5(audio[1])
|