Commit
·
8465d71
1
Parent(s):
f9d7c5e
Update app.py
Browse files
app.py
CHANGED
@@ -34,8 +34,6 @@ def one_shot(image,input_text,gender):
|
|
34 |
sound = AudioSegment.from_file(f.name, format="mp3")
|
35 |
sound.export("/content/audio.wav", format="wav")
|
36 |
waveform, sample_rate = torchaudio.load("/content/audio.wav")
|
37 |
-
|
38 |
-
|
39 |
torchaudio.save("/content/audio.wav", waveform, sample_rate, encoding="PCM_S", bits_per_sample=16)
|
40 |
image = Image.open(image_in)
|
41 |
image = pad_image(image)
|
@@ -47,7 +45,7 @@ def one_shot(image,input_text,gender):
|
|
47 |
|
48 |
os.system(f"cd /content/one-shot-talking-face && python3 -B test_script.py --img_path /content/image_pre.png --audio_path /content/audio.wav --phoneme_path /content/test.json --save_dir /content/train")
|
49 |
|
50 |
-
return "/content/
|
51 |
|
52 |
|
53 |
elif gender == 'Male' or gender == 'male':
|
@@ -90,7 +88,7 @@ def run():
|
|
90 |
# audio_in = gr.Audio(show_label=False, type='filepath')
|
91 |
input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
|
92 |
gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
|
93 |
-
video_out = gr.
|
94 |
# video_out = gr.Video(show_label=False)
|
95 |
with gr.Row().style(equal_height=True):
|
96 |
btn = gr.Button("Generate")
|
|
|
34 |
sound = AudioSegment.from_file(f.name, format="mp3")
|
35 |
sound.export("/content/audio.wav", format="wav")
|
36 |
waveform, sample_rate = torchaudio.load("/content/audio.wav")
|
|
|
|
|
37 |
torchaudio.save("/content/audio.wav", waveform, sample_rate, encoding="PCM_S", bits_per_sample=16)
|
38 |
image = Image.open(image_in)
|
39 |
image = pad_image(image)
|
|
|
45 |
|
46 |
os.system(f"cd /content/one-shot-talking-face && python3 -B test_script.py --img_path /content/image_pre.png --audio_path /content/audio.wav --phoneme_path /content/test.json --save_dir /content/train")
|
47 |
|
48 |
+
return "/content/image_pre.png"
|
49 |
|
50 |
|
51 |
elif gender == 'Male' or gender == 'male':
|
|
|
88 |
# audio_in = gr.Audio(show_label=False, type='filepath')
|
89 |
input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
|
90 |
gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
|
91 |
+
video_out = gr.Image(label="output")
|
92 |
# video_out = gr.Video(show_label=False)
|
93 |
with gr.Row().style(equal_height=True):
|
94 |
btn = gr.Button("Generate")
|