Spaces:
Running
Running
Adjust gallery and rename yolos_button
Browse files
app.py
CHANGED
@@ -93,11 +93,12 @@ if __name__ == "__main__":
|
|
93 |
with gr.Row():
|
94 |
with gr.Column():
|
95 |
yolos_input = gr.Image(type="pil")
|
96 |
-
|
|
|
|
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
yolos_selected = gr.Number(label="Selected Image Index")
|
101 |
|
102 |
with gr.Tab("Inference"):
|
103 |
with gr.Row():
|
@@ -108,7 +109,7 @@ if __name__ == "__main__":
|
|
108 |
moon_output = gr.TextArea(label="Output")
|
109 |
|
110 |
# --- YOLOS --- #
|
111 |
-
|
112 |
yolos_output.select(get_selected_index, None, yolos_selected)
|
113 |
|
114 |
# --- Moondream --- #
|
|
|
93 |
with gr.Row():
|
94 |
with gr.Column():
|
95 |
yolos_input = gr.Image(type="pil")
|
96 |
+
yolos_submit = gr.Button("Submit")
|
97 |
+
yolos_output = gr.Gallery(label="Detected Objects", object_fit="scale-down", columns=3, scale=2,
|
98 |
+
show_share_button=False, allow_preview=False, selected_index=None)
|
99 |
|
100 |
+
with gr.Row():
|
101 |
+
yolos_selected = gr.Number(label="Selected Image Index")
|
|
|
102 |
|
103 |
with gr.Tab("Inference"):
|
104 |
with gr.Row():
|
|
|
109 |
moon_output = gr.TextArea(label="Output")
|
110 |
|
111 |
# --- YOLOS --- #
|
112 |
+
yolos_submit.click(detect_objects, [yolos_input], yolos_output)
|
113 |
yolos_output.select(get_selected_index, None, yolos_selected)
|
114 |
|
115 |
# --- Moondream --- #
|