Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def yolov10_inference(image, model_id, image_size, conf_threshold, iou_threshold
|
|
| 26 |
return Image.fromarray(annotated_image[..., ::-1])
|
| 27 |
|
| 28 |
def app():
|
| 29 |
-
with gr.Blocks():
|
| 30 |
with gr.Row():
|
| 31 |
with gr.Column():
|
| 32 |
image = gr.Image(type="pil", label="Image")
|
|
@@ -67,23 +67,18 @@ def app():
|
|
| 67 |
|
| 68 |
with gr.Column():
|
| 69 |
output_image = gr.Image(type="pil", label="Annotated Image")
|
| 70 |
-
|
| 71 |
yolov10_infer.click(
|
| 72 |
fn=yolov10_inference,
|
| 73 |
inputs=[image, model_id, image_size, conf_threshold, iou_threshold],
|
| 74 |
outputs=[output_image],
|
| 75 |
)
|
| 76 |
-
|
| 77 |
gr.Examples(
|
| 78 |
-
examples=[
|
| 79 |
-
|
| 80 |
-
["dog.jpeg", "yolov10s", 640, 0.25, 0.45],
|
| 81 |
-
],
|
| 82 |
-
inputs=[image, model_id, image_size, conf_threshold, iou_threshold],
|
| 83 |
-
outputs=[output_image],
|
| 84 |
-
fn=yolov10_inference,
|
| 85 |
-
cache_examples="lazy",
|
| 86 |
)
|
|
|
|
| 87 |
|
| 88 |
if __name__ == "__main__":
|
| 89 |
-
app().launch()
|
|
|
|
| 26 |
return Image.fromarray(annotated_image[..., ::-1])
|
| 27 |
|
| 28 |
def app():
|
| 29 |
+
with gr.Blocks() as demo:
|
| 30 |
with gr.Row():
|
| 31 |
with gr.Column():
|
| 32 |
image = gr.Image(type="pil", label="Image")
|
|
|
|
| 67 |
|
| 68 |
with gr.Column():
|
| 69 |
output_image = gr.Image(type="pil", label="Annotated Image")
|
| 70 |
+
|
| 71 |
yolov10_infer.click(
|
| 72 |
fn=yolov10_inference,
|
| 73 |
inputs=[image, model_id, image_size, conf_threshold, iou_threshold],
|
| 74 |
outputs=[output_image],
|
| 75 |
)
|
| 76 |
+
|
| 77 |
gr.Examples(
|
| 78 |
+
examples=["Rocket.png"],
|
| 79 |
+
inputs=[image],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
)
|
| 81 |
+
return demo
|
| 82 |
|
| 83 |
if __name__ == "__main__":
|
| 84 |
+
app().launch()
|