Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,7 +98,15 @@ with demo:
|
|
| 98 |
options = gr.Dropdown(choices=models,label='Select Object Detection Model',show_label=True)
|
| 99 |
slider_input = gr.Slider(minimum=0.2,maximum=1,value=0.7,label='Prediction Threshold')
|
| 100 |
|
| 101 |
-
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
with gr.TabItem('Image Upload'):
|
| 103 |
with gr.Row():
|
| 104 |
img_input = gr.Image(type='pil')
|
|
@@ -111,9 +119,10 @@ with demo:
|
|
| 111 |
|
| 112 |
img_but = gr.Button('Detect')
|
| 113 |
|
| 114 |
-
|
| 115 |
img_but.click(detect_objects,inputs=[options,img_input,slider_input],outputs=img_output_from_upload,queue=True)
|
| 116 |
example_images.click(fn=set_example_image,inputs=[example_images],outputs=[img_input])
|
|
|
|
| 117 |
|
| 118 |
|
| 119 |
#gr.Markdown("")
|
|
|
|
| 98 |
options = gr.Dropdown(choices=models,label='Select Object Detection Model',show_label=True)
|
| 99 |
slider_input = gr.Slider(minimum=0.2,maximum=1,value=0.7,label='Prediction Threshold')
|
| 100 |
|
| 101 |
+
with gr.Tabs():
|
| 102 |
+
with gr.TabItem('Image URL'):
|
| 103 |
+
with gr.Row():
|
| 104 |
+
url_input = gr.Textbox(lines=2,label='Enter valid image URL here..')
|
| 105 |
+
img_output_from_url = gr.Image(shape=(650,650))
|
| 106 |
+
|
| 107 |
+
with gr.Row():
|
| 108 |
+
example_url = gr.Dataset(components=[url_input],samples=[[str(url)] for url in urls])
|
| 109 |
+
|
| 110 |
with gr.TabItem('Image Upload'):
|
| 111 |
with gr.Row():
|
| 112 |
img_input = gr.Image(type='pil')
|
|
|
|
| 119 |
|
| 120 |
img_but = gr.Button('Detect')
|
| 121 |
|
| 122 |
+
url_but.click(detect_objects,inputs=[options,url_input,,slider_input],outputs=img_output_from_url,queue=True)
|
| 123 |
img_but.click(detect_objects,inputs=[options,img_input,slider_input],outputs=img_output_from_upload,queue=True)
|
| 124 |
example_images.click(fn=set_example_image,inputs=[example_images],outputs=[img_input])
|
| 125 |
+
example_url.click(fn=set_example_url,inputs=[example_url],outputs=[url_input])
|
| 126 |
|
| 127 |
|
| 128 |
#gr.Markdown("")
|