Spaces:
Running
Running
reorder input component layout
Browse files
app.py
CHANGED
@@ -162,12 +162,38 @@ with gradio.Blocks(title=TITLE, head=CUSTOM_JS, css=CUSTOM_CSS) as gradio_app:
|
|
162 |
)
|
163 |
with gradio.Row(): # Inputs and Outputs
|
164 |
with gradio.Column(): # Inputs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
gradio.Markdown("## Input Text")
|
166 |
with gradio.Row():
|
167 |
with gradio.Column(): # Source TextArea
|
168 |
gradio.Markdown("Write here (in selected language):")
|
169 |
source_textbox = gradio.Textbox(
|
170 |
-
lines=
|
171 |
placeholder="Enter Text Here...",
|
172 |
label="Spoken Language Sentence",
|
173 |
show_copy_button=True,
|
@@ -198,32 +224,6 @@ with gradio.Blocks(title=TITLE, head=CUSTOM_JS, css=CUSTOM_CSS) as gradio_app:
|
|
198 |
api_name=False,
|
199 |
)
|
200 |
|
201 |
-
gradio.Markdown("## Select Languages")
|
202 |
-
with gradio.Row():
|
203 |
-
text_lang_dropdown = gradio.Dropdown(
|
204 |
-
choices=[code.value for code in slt.TextLanguageCodes],
|
205 |
-
value=slt.TextLanguageCodes.URDU.value,
|
206 |
-
label="Text Language",
|
207 |
-
elem_id="text-lang-dropdown",
|
208 |
-
)
|
209 |
-
text_lang_dropdown.change(
|
210 |
-
None, inputs=text_lang_dropdown, js="updateTextareaDir"
|
211 |
-
)
|
212 |
-
sign_lang_dropdown = gradio.Dropdown(
|
213 |
-
choices=[code.value for code in slt.SignLanguageCodes],
|
214 |
-
value=slt.SignLanguageCodes.PAKISTAN_SIGN_LANGUAGE.value,
|
215 |
-
label="Sign Language",
|
216 |
-
)
|
217 |
-
output_format_dropdown = gradio.Dropdown(
|
218 |
-
choices=[
|
219 |
-
slt.SignFormatCodes.VIDEO.value,
|
220 |
-
slt.SignFormatCodes.LANDMARKS.value,
|
221 |
-
],
|
222 |
-
value=slt.SignFormatCodes.VIDEO.value,
|
223 |
-
label="Output Format",
|
224 |
-
)
|
225 |
-
# todo: sign format: video/landmarks (tabs?)
|
226 |
-
|
227 |
with gradio.Column(): # Outputs
|
228 |
gradio.Markdown("## Output Sign Language")
|
229 |
output_video = gradio.Video(
|
@@ -253,7 +253,7 @@ with gradio.Blocks(title=TITLE, head=CUSTOM_JS, css=CUSTOM_CSS) as gradio_app:
|
|
253 |
["یہ بہت اچھا ہے۔", "ur", "pakistan-sign-language", "video"],
|
254 |
["وہ کام آسان تھا۔", "ur", "pakistan-sign-language", "landmarks"],
|
255 |
["पाँच घंटे।", "hi", "pakistan-sign-language", "video"],
|
256 |
-
|
257 |
],
|
258 |
inputs=[source_textbox, text_lang_dropdown, sign_lang_dropdown, output_format_dropdown],
|
259 |
outputs=output_video,
|
|
|
162 |
)
|
163 |
with gradio.Row(): # Inputs and Outputs
|
164 |
with gradio.Column(): # Inputs
|
165 |
+
gradio.Markdown("## Select Languages")
|
166 |
+
with gradio.Row():
|
167 |
+
text_lang_dropdown = gradio.Dropdown(
|
168 |
+
choices=[code.value for code in slt.TextLanguageCodes],
|
169 |
+
value=slt.TextLanguageCodes.URDU.value,
|
170 |
+
label="Text Language",
|
171 |
+
elem_id="text-lang-dropdown",
|
172 |
+
)
|
173 |
+
text_lang_dropdown.change(
|
174 |
+
None, inputs=text_lang_dropdown, js="updateTextareaDir"
|
175 |
+
)
|
176 |
+
sign_lang_dropdown = gradio.Dropdown(
|
177 |
+
choices=[code.value for code in slt.SignLanguageCodes],
|
178 |
+
value=slt.SignLanguageCodes.PAKISTAN_SIGN_LANGUAGE.value,
|
179 |
+
label="Sign Language",
|
180 |
+
)
|
181 |
+
output_format_dropdown = gradio.Dropdown(
|
182 |
+
choices=[
|
183 |
+
slt.SignFormatCodes.VIDEO.value,
|
184 |
+
slt.SignFormatCodes.LANDMARKS.value,
|
185 |
+
],
|
186 |
+
value=slt.SignFormatCodes.VIDEO.value,
|
187 |
+
label="Output Format",
|
188 |
+
)
|
189 |
+
# todo: sign format: video/landmarks (tabs?)
|
190 |
+
|
191 |
gradio.Markdown("## Input Text")
|
192 |
with gradio.Row():
|
193 |
with gradio.Column(): # Source TextArea
|
194 |
gradio.Markdown("Write here (in selected language):")
|
195 |
source_textbox = gradio.Textbox(
|
196 |
+
lines=2,
|
197 |
placeholder="Enter Text Here...",
|
198 |
label="Spoken Language Sentence",
|
199 |
show_copy_button=True,
|
|
|
224 |
api_name=False,
|
225 |
)
|
226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
with gradio.Column(): # Outputs
|
228 |
gradio.Markdown("## Output Sign Language")
|
229 |
output_video = gradio.Video(
|
|
|
253 |
["یہ بہت اچھا ہے۔", "ur", "pakistan-sign-language", "video"],
|
254 |
["وہ کام آسان تھا۔", "ur", "pakistan-sign-language", "landmarks"],
|
255 |
["पाँच घंटे।", "hi", "pakistan-sign-language", "video"],
|
256 |
+
["कैसे हैं आप?", "hi", "pakistan-sign-language", "video"],
|
257 |
],
|
258 |
inputs=[source_textbox, text_lang_dropdown, sign_lang_dropdown, output_format_dropdown],
|
259 |
outputs=output_video,
|