Spaces:
Running
Running
gradio
Browse files- F5-TTS/src/f5_tts/infer/infer_cli_test.py +7 -1
- app.py +12 -1
F5-TTS/src/f5_tts/infer/infer_cli_test.py
CHANGED
@@ -203,6 +203,11 @@ parser.add_argument(
|
|
203 |
type=str,
|
204 |
default="",
|
205 |
)
|
|
|
|
|
|
|
|
|
|
|
206 |
parser.add_argument(
|
207 |
"--txt",
|
208 |
type=str,
|
@@ -446,7 +451,8 @@ if __name__ == "__main__":
|
|
446 |
video, txt, wav = data
|
447 |
video_p, txt_p, wav_p = data_p
|
448 |
|
449 |
-
v2a_audio = v2a_path + video.replace("/", "__").strip(".") + ".flac"
|
|
|
450 |
#v2a_audio_p = v2a_path + video_p.replace("/", "__").strip(".") + ".flac"
|
451 |
|
452 |
print(video, wav, v2a_audio, video_p, wav_p)
|
|
|
203 |
type=str,
|
204 |
default="",
|
205 |
)
|
206 |
+
parser.add_argument(
|
207 |
+
"--v2a_wav",
|
208 |
+
type=str,
|
209 |
+
default="",
|
210 |
+
)
|
211 |
parser.add_argument(
|
212 |
"--txt",
|
213 |
type=str,
|
|
|
451 |
video, txt, wav = data
|
452 |
video_p, txt_p, wav_p = data_p
|
453 |
|
454 |
+
#v2a_audio = v2a_path + video.replace("/", "__").strip(".") + ".flac"
|
455 |
+
v2a_audio = args.v2a_wav
|
456 |
#v2a_audio_p = v2a_path + video_p.replace("/", "__").strip(".") + ".flac"
|
457 |
|
458 |
print(video, wav, v2a_audio, video_p, wav_p)
|
app.py
CHANGED
@@ -20,6 +20,17 @@ import requests
|
|
20 |
import shutil
|
21 |
import numpy as np
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
log = logging.getLogger()
|
24 |
|
25 |
|
@@ -60,7 +71,7 @@ def video_to_audio_and_speech(video: gr.Video, prompt: str, text: str, audio_pro
|
|
60 |
print("v2a command", command)
|
61 |
os.system(command)
|
62 |
|
63 |
-
command = "python ./F5-TTS/src/f5_tts/infer/infer_cli_test.py --output_dir %s --start 0 --end 1 --ckpt_file ./F5-TTS/ckpts/v2c/v2c_s44.pt --v2a_path %s --wav_p %s --txt_p \"%s\" --video %s --txt \"%s\"" % (output_dir, output_dir, audio_p_path, text_prompt, video_save_path, text)
|
64 |
print("v2s command", command)
|
65 |
os.system(command)
|
66 |
video_gen = output_dir + "/videos/gen/0001"
|
|
|
20 |
import shutil
|
21 |
import numpy as np
|
22 |
|
23 |
+
from huggingface_hub import hf_hub_download
|
24 |
+
|
25 |
+
model_path = "./F5-TTS/ckpts/v2c/"
|
26 |
+
|
27 |
+
if not os.path.exists(model_path):
|
28 |
+
os.makedirs(model_path)
|
29 |
+
|
30 |
+
file_path = hf_hub_download(repo_id="lshzhm/DeepAudio-V1", filename="v2c_s44.pt", local_dir=model_path)
|
31 |
+
|
32 |
+
print(f"Model saved at: {file_path}")
|
33 |
+
|
34 |
log = logging.getLogger()
|
35 |
|
36 |
|
|
|
71 |
print("v2a command", command)
|
72 |
os.system(command)
|
73 |
|
74 |
+
command = "python ./F5-TTS/src/f5_tts/infer/infer_cli_test.py --output_dir %s --start 0 --end 1 --ckpt_file ./F5-TTS/ckpts/v2c/v2c_s44.pt --v2a_path %s --wav_p %s --txt_p \"%s\" --video %s --v2a_wav %s --txt \"%s\"" % (output_dir, output_dir, audio_p_path, text_prompt, video_save_path, video_save_path[:-4]+".flac", text)
|
75 |
print("v2s command", command)
|
76 |
os.system(command)
|
77 |
video_gen = output_dir + "/videos/gen/0001"
|