Update app.py
Browse files
app.py
CHANGED
@@ -93,15 +93,26 @@ examples = [
|
|
93 |
["images/1.png", "Large"]
|
94 |
]
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
# Create the Gradio interface with Blocks
|
97 |
with gr.Blocks(theme="bethecloud/storj_theme") as demo:
|
98 |
-
gr.Markdown("# **Florence-2 Models Image Captions**")
|
99 |
gr.Markdown(description)
|
100 |
with gr.Row():
|
101 |
image_input = gr.Image(label="Upload Image", type="pil")
|
102 |
model_choice = gr.Radio(["Base", "Large"], label="Model Choice", value="Base")
|
103 |
output = gr.Textbox(label="Generated Caption", lines=4, show_copy_button=True)
|
104 |
-
generate_btn = gr.Button("Generate Caption"
|
|
|
105 |
generate_btn.click(fn=describe_image, inputs=[image_input, model_choice], outputs=output)
|
106 |
gr.Examples(examples=examples, inputs=[image_input, model_choice])
|
107 |
|
|
|
93 |
["images/1.png", "Large"]
|
94 |
]
|
95 |
|
96 |
+
css = """
|
97 |
+
.submit-btn {
|
98 |
+
background-color: #4682B4 !important;
|
99 |
+
color: white !important;
|
100 |
+
}
|
101 |
+
.submit-btn:hover {
|
102 |
+
background-color: #87CEEB !important;
|
103 |
+
}
|
104 |
+
"""
|
105 |
+
|
106 |
# Create the Gradio interface with Blocks
|
107 |
with gr.Blocks(theme="bethecloud/storj_theme") as demo:
|
108 |
+
gr.Markdown("# **[Florence-2 Models Image Captions](https://huggingface.co/collections/prithivMLmods/multimodal-implementations-67c9982ea04b39f0608badb0)**")
|
109 |
gr.Markdown(description)
|
110 |
with gr.Row():
|
111 |
image_input = gr.Image(label="Upload Image", type="pil")
|
112 |
model_choice = gr.Radio(["Base", "Large"], label="Model Choice", value="Base")
|
113 |
output = gr.Textbox(label="Generated Caption", lines=4, show_copy_button=True)
|
114 |
+
generate_btn = gr.Button("Generate Caption",
|
115 |
+
elem_classes="submit-btn")
|
116 |
generate_btn.click(fn=describe_image, inputs=[image_input, model_choice], outputs=output)
|
117 |
gr.Examples(examples=examples, inputs=[image_input, model_choice])
|
118 |
|