Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -193,47 +193,46 @@ with gr.Blocks(css=css, title="Real-Time YOLOv5 Video & Image Object Detection")
|
|
193 |
)
|
194 |
|
195 |
with gr.TabItem("Image Detection", elem_classes="tab-item"):
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
|
234 |
gr.Markdown("""
|
235 |
### Powered by YOLOv5.
|
236 |
This application allows real-time object detection using the YOLOv5 model.
|
237 |
""", elem_classes="footer")
|
238 |
|
239 |
-
demo.launch()
|
|
|
193 |
)
|
194 |
|
195 |
with gr.TabItem("Image Detection", elem_classes="tab-item"):
|
196 |
+
with gr.Row():
|
197 |
+
image_input = gr.Image(
|
198 |
+
type="pil",
|
199 |
+
label="Upload Image",
|
200 |
+
interactive=True
|
201 |
+
)
|
202 |
+
|
203 |
+
with gr.Row(elem_classes="button-row"):
|
204 |
+
clear_button = gr.Button(
|
205 |
+
"Clear",
|
206 |
+
variant="secondary",
|
207 |
+
elem_id="clear-btn"
|
208 |
+
)
|
209 |
+
submit_button = gr.Button(
|
210 |
+
"Detect Objects",
|
211 |
+
variant="primary",
|
212 |
+
elem_id="submit-btn"
|
213 |
+
)
|
214 |
+
|
215 |
+
with gr.Row(elem_classes="output-container"):
|
216 |
+
image_output = gr.Image(
|
217 |
+
label="Detected Objects",
|
218 |
+
elem_id="image-output"
|
219 |
+
)
|
220 |
+
|
221 |
+
clear_button.click(
|
222 |
+
fn=lambda: None,
|
223 |
+
inputs=None,
|
224 |
+
outputs=image_output
|
225 |
+
)
|
226 |
+
|
227 |
+
submit_button.click(
|
228 |
+
fn=process_image,
|
229 |
+
inputs=image_input,
|
230 |
+
outputs=image_output
|
231 |
+
)
|
|
|
232 |
|
233 |
gr.Markdown("""
|
234 |
### Powered by YOLOv5.
|
235 |
This application allows real-time object detection using the YOLOv5 model.
|
236 |
""", elem_classes="footer")
|
237 |
|
238 |
+
demo.launch()
|