Spaces:
Running
Running
μ‘νκ·
commited on
Commit
Β·
85302a7
1
Parent(s):
40e54ff
hotfix | upgrade gradio version and fix code (`267056d` in https://bitbucket.org/maum-system/cvpr22-demo-gradio)
Browse files
README.md
CHANGED
|
@@ -4,6 +4,7 @@ emoji: π
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
|
|
|
| 7 |
app_file: app.py
|
| 8 |
pinned: false
|
| 9 |
license: cc-by-nc-sa-4.0
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 3.0.6
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: cc-by-nc-sa-4.0
|
app.py
CHANGED
|
@@ -148,38 +148,38 @@ class GradioApplication:
|
|
| 148 |
|
| 149 |
|
| 150 |
def prepare_input():
|
| 151 |
-
text_input = gr.
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
lang_input = gr.
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
duration_rate_input = gr.
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
start_padding_input = gr.
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
end_padding_input = gr.
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
action_input = gr.
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
background_input = gr.
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
|
| 184 |
return [text_input, lang_input,
|
| 185 |
duration_rate_input, start_padding_input, end_padding_input,
|
|
@@ -187,10 +187,10 @@ def prepare_input():
|
|
| 187 |
|
| 188 |
|
| 189 |
def prepare_output():
|
| 190 |
-
translation_result_otuput = gr.
|
| 191 |
label="Translation Result")
|
| 192 |
|
| 193 |
-
video_output = gr.
|
| 194 |
return [translation_result_otuput, video_output]
|
| 195 |
|
| 196 |
|
|
|
|
| 148 |
|
| 149 |
|
| 150 |
def prepare_input():
|
| 151 |
+
text_input = gr.Textbox(lines=2,
|
| 152 |
+
placeholder="Type your text with English, Chinese, Korean, and Japanese.",
|
| 153 |
+
value="Hello, this is demonstration for talking face generation "
|
| 154 |
+
"with multilingual text-to-speech.",
|
| 155 |
+
label="Text")
|
| 156 |
+
lang_input = gr.Radio(['Korean', 'English', 'Japanese', 'Chinese'],
|
| 157 |
+
type='value',
|
| 158 |
+
value=None,
|
| 159 |
+
label="Language")
|
| 160 |
+
duration_rate_input = gr.Slider(minimum=0.8,
|
| 161 |
+
maximum=1.2,
|
| 162 |
+
step=0.01,
|
| 163 |
+
value=1.0,
|
| 164 |
+
label="Duration (The bigger the value, the slower it pronounces)")
|
| 165 |
+
start_padding_input = gr.Slider(minimum=0.0,
|
| 166 |
+
maximum=2.0,
|
| 167 |
+
step=0.1,
|
| 168 |
+
value=0.0,
|
| 169 |
+
label="Start padding (s)")
|
| 170 |
+
end_padding_input = gr.Slider(minimum=0.0,
|
| 171 |
+
maximum=2.0,
|
| 172 |
+
step=0.1,
|
| 173 |
+
value=0.0,
|
| 174 |
+
label="End padding (s)")
|
| 175 |
+
action_input = gr.Radio(['Default', 'Hand', 'BothHand', 'HandDown', 'Sorry'],
|
| 176 |
+
type='value',
|
| 177 |
+
value='Default',
|
| 178 |
+
label="Select an action ...")
|
| 179 |
+
background_input = gr.Radio(['None', 'CVPR', 'Black', 'River', 'Sky'],
|
| 180 |
+
type='index',
|
| 181 |
+
value='None',
|
| 182 |
+
label="Select a background image/video ...")
|
| 183 |
|
| 184 |
return [text_input, lang_input,
|
| 185 |
duration_rate_input, start_padding_input, end_padding_input,
|
|
|
|
| 187 |
|
| 188 |
|
| 189 |
def prepare_output():
|
| 190 |
+
translation_result_otuput = gr.Textbox(type="str",
|
| 191 |
label="Translation Result")
|
| 192 |
|
| 193 |
+
video_output = gr.Video(format='mp4')
|
| 194 |
return [translation_result_otuput, video_output]
|
| 195 |
|
| 196 |
|