Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,24 +41,24 @@ def generate_image_and_translate(image, num_images=1):
|
|
41 |
|
42 |
# Set up the Gradio interface
|
43 |
interface = gr.Interface(
|
44 |
-
fn=generate_image_and_translate,
|
45 |
inputs=[
|
46 |
-
gr.Image(type="pil", label="Upload Image"),
|
47 |
-
gr.Slider(minimum=1, maximum=10, label="Number of Images", value=1, step=1)
|
48 |
],
|
49 |
outputs=[
|
50 |
-
gr.Gallery(label="Generated Images"),
|
51 |
-
gr.Textbox(label="Generated Caption (English)", interactive=False),
|
52 |
-
gr.Textbox(label="Translated Caption (Arabic)", interactive=False)
|
53 |
-
|
54 |
],
|
55 |
-
title="Image Generation and Translation",
|
56 |
-
description="Upload an image to generate new images based on its caption and translate the caption into Arabic.",
|
57 |
-
|
58 |
-
["sea.jpg", 3]
|
59 |
-
]
|
60 |
)
|
61 |
|
|
|
|
|
|
|
62 |
|
63 |
# Launch the Gradio application
|
64 |
interface.launch()
|
|
|
41 |
|
42 |
# Set up the Gradio interface
|
43 |
interface = gr.Interface(
|
44 |
+
fn=generate_image_and_translate,
|
45 |
inputs=[
|
46 |
+
gr.Image(type="pil", label="Upload Image"),
|
47 |
+
gr.Slider(minimum=1, maximum=10, label="Number of Images", value=1, step=1)
|
48 |
],
|
49 |
outputs=[
|
50 |
+
gr.Gallery(label="Generated Images"),
|
51 |
+
gr.Textbox(label="Generated Caption (English)", interactive=False),
|
52 |
+
gr.Textbox(label="Translated Caption (Arabic)", interactive=False)
|
|
|
53 |
],
|
54 |
+
title="Image Generation and Translation",
|
55 |
+
description="Upload an image to generate new images based on its caption and translate the caption into Arabic.",
|
56 |
+
theme='freddyaboulton/dracula_revamped'
|
|
|
|
|
57 |
)
|
58 |
|
59 |
+
if __name__ == "__main__":
|
60 |
+
interface.launch()
|
61 |
+
|
62 |
|
63 |
# Launch the Gradio application
|
64 |
interface.launch()
|