1Noura commited on
Commit
1ef8ed4
·
verified ·
1 Parent(s): 6554f8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
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, # Function to call when processing input
45
  inputs=[
46
- gr.Image(type="pil", label="Upload Image"), # Input for image upload
47
- gr.Slider(minimum=1, maximum=10, label="Number of Images", value=1, step=1) # Slider to select number of images
48
  ],
49
  outputs=[
50
- gr.Gallery(label="Generated Images"), # Output for displaying generated images
51
- gr.Textbox(label="Generated Caption (English)", interactive=False), # Output for English caption
52
- gr.Textbox(label="Translated Caption (Arabic)", interactive=False)# Output for Arabic caption
53
-
54
  ],
55
- title="Image Generation and Translation", # Title of the interface
56
- description="Upload an image to generate new images based on its caption and translate the caption into Arabic.", # Description
57
- examples=[
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()