Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,14 +14,17 @@ with gr.Blocks() as demo:
|
|
14 |
title = gr.Markdown(
|
15 |
"""
|
16 |
# African Language Image Captioning
|
17 |
-
Based on the Khaya AI
|
18 |
-
""")
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
["https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/rotated_image.jpeg"]]
|
|
|
|
|
|
|
25 |
btn = gr.Button("Generate African Language Caption")
|
26 |
btn.click(generate, inputs=inputs, outputs=outputs)
|
27 |
|
|
|
14 |
title = gr.Markdown(
|
15 |
"""
|
16 |
# African Language Image Captioning
|
17 |
+
Based on the Khaya AI Translation API, Lesan Translation API, Google Translate API and the BLIP model. Lesan is used for Amharic and Tigrinya, Google is used for Hausa and Swahili, and Khaya is used for the remainder."
|
18 |
+
""")
|
19 |
+
with gr.Row():
|
20 |
+
with gr.Column(scale=1):
|
21 |
+
language_selector = gr.Dropdown(["Twi","Dagbani","Ewe","Ga","Gurene","Fante","Hausa", "Kikuyu", "Kimeru", "Luo","Shona","Swahili","Tigrinya","Yoruba"],value="Twi",label="Choose Language! (default is Twi)", info="Language:")
|
22 |
+
inputs = [gr.Image(type="filepath"),language_selector]
|
23 |
+
examples = [["https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png"],
|
24 |
["https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/rotated_image.jpeg"]]
|
25 |
+
with gr.Column(scale=1):
|
26 |
+
outputs = [gr.Textbox(label="English Caption"), gr.Textbox(label="African Language Caption"),
|
27 |
+
gr.Image(label="Output image with predicted instances", type="filepath")]
|
28 |
btn = gr.Button("Generate African Language Caption")
|
29 |
btn.click(generate, inputs=inputs, outputs=outputs)
|
30 |
|