prithivMLmods commited on
Commit
d2e8362
·
verified ·
1 Parent(s): 2e674da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -110,16 +110,18 @@ with gr.Blocks(theme="bethecloud/storj_theme", css=css) as demo:
110
  gr.Markdown("# **[Florence-2 Models Image Captions](https://huggingface.co/collections/prithivMLmods/multimodal-implementations-67c9982ea04b39f0608badb0)**")
111
  gr.Markdown(description)
112
  with gr.Row():
113
- image_input = gr.Image(label="Upload Image", type="pil")
114
- model_choice = gr.Radio(["Base", "Large"], label="Model Choice", value="Base")
115
-
116
- with gr.Column(elem_classes="canvas-output"):
 
 
 
117
  output = gr.Textbox(label="Generated Caption", lines=4, show_copy_button=True)
118
-
119
- generate_btn = gr.Button("Generate Caption",
120
- elem_classes="submit-btn")
121
  generate_btn.click(fn=describe_image, inputs=[image_input, model_choice], outputs=output)
122
- gr.Examples(examples=examples, inputs=[image_input, model_choice])
123
 
124
  # Launch the interface
125
  demo.launch(debug=True)
 
110
  gr.Markdown("# **[Florence-2 Models Image Captions](https://huggingface.co/collections/prithivMLmods/multimodal-implementations-67c9982ea04b39f0608badb0)**")
111
  gr.Markdown(description)
112
  with gr.Row():
113
+ # Left column: Input image and Generate button
114
+ with gr.Column():
115
+ image_input = gr.Image(label="Upload Image", type="pil")
116
+ generate_btn = gr.Button("Generate Caption", elem_classes="submit-btn")
117
+ # Right column: Model choice, output, and examples
118
+ with gr.Column():
119
+ model_choice = gr.Radio(["Base", "Large"], label="Model Choice", value="Base")
120
  output = gr.Textbox(label="Generated Caption", lines=4, show_copy_button=True)
121
+ gr.Examples(examples=examples, inputs=[image_input, model_choice])
122
+
123
+ # Connect the button to the function
124
  generate_btn.click(fn=describe_image, inputs=[image_input, model_choice], outputs=output)
 
125
 
126
  # Launch the interface
127
  demo.launch(debug=True)