Spaces:
Running
Running
Swap order of UI elements
Browse filesMakes more sense to have buttons on top, especially if images are large
app.py
CHANGED
@@ -131,23 +131,23 @@ if __name__ == "__main__":
|
|
131 |
with gr.Tabs() as tabs:
|
132 |
with gr.Tab("Object Detection", id='yolos'):
|
133 |
with gr.Row(equal_height=False):
|
134 |
-
with gr.
|
135 |
-
yolos_input = gr.Image(label="Input Image", type="pil", interactive=True, mirror_webcam=False)
|
136 |
yolos_submit = gr.Button("Detect Objects", interactive=False)
|
137 |
-
|
|
|
|
|
138 |
yolos_gallery = gr.Gallery(label="Detected Objects", object_fit="scale-down", columns=3,
|
139 |
show_share_button=False, selected_index=None, allow_preview=False,
|
140 |
type="pil", interactive=False)
|
141 |
-
proceed_button = gr.Button("To Moondream", interactive=False)
|
142 |
|
143 |
with gr.Tab("Inference", id='moondream'):
|
144 |
with gr.Row(equal_height=False):
|
145 |
with gr.Column():
|
146 |
-
moon_img = gr.Image(label="Image", type="pil", interactive=True, mirror_webcam=False)
|
147 |
with gr.Group():
|
148 |
moon_prompt = gr.Textbox(label="Ask a question about the image:",
|
149 |
value="What is this food item? Include any text on labels.")
|
150 |
moon_submit = gr.Button("Submit", interactive=False)
|
|
|
151 |
moon_output = gr.TextArea(label="Answer", interactive=False)
|
152 |
|
153 |
# --- YOLOS --- #
|
|
|
131 |
with gr.Tabs() as tabs:
|
132 |
with gr.Tab("Object Detection", id='yolos'):
|
133 |
with gr.Row(equal_height=False):
|
134 |
+
with gr.Column():
|
|
|
135 |
yolos_submit = gr.Button("Detect Objects", interactive=False)
|
136 |
+
yolos_input = gr.Image(label="Input Image", type="pil", interactive=True, mirror_webcam=False)
|
137 |
+
with gr.Column():
|
138 |
+
proceed_button = gr.Button("To Moondream", interactive=False)
|
139 |
yolos_gallery = gr.Gallery(label="Detected Objects", object_fit="scale-down", columns=3,
|
140 |
show_share_button=False, selected_index=None, allow_preview=False,
|
141 |
type="pil", interactive=False)
|
|
|
142 |
|
143 |
with gr.Tab("Inference", id='moondream'):
|
144 |
with gr.Row(equal_height=False):
|
145 |
with gr.Column():
|
|
|
146 |
with gr.Group():
|
147 |
moon_prompt = gr.Textbox(label="Ask a question about the image:",
|
148 |
value="What is this food item? Include any text on labels.")
|
149 |
moon_submit = gr.Button("Submit", interactive=False)
|
150 |
+
moon_img = gr.Image(label="Image", type="pil", interactive=True, mirror_webcam=False)
|
151 |
moon_output = gr.TextArea(label="Answer", interactive=False)
|
152 |
|
153 |
# --- YOLOS --- #
|