Update app.py
Browse files
app.py
CHANGED
@@ -113,6 +113,7 @@ Links to HuggingFace Models:
|
|
113 |
|
114 |
models = ["nickmuchi/yolos-small-rego-plates-detection","nickmuchi/yolos-small-license-plate-detection"]
|
115 |
urls = ["https://drive.google.com/uc?id=1j9VZQ4NDS4gsubFf3m2qQoTMWLk552bQ","https://drive.google.com/uc?id=1p9wJIqRz3W50e2f_A0D8ftla8hoXz4T5"]
|
|
|
116 |
|
117 |
twitter_link = """
|
118 |
[![](https://img.shields.io/twitter/follow/nickmuchi?label=@nickmuchi&style=social)](https://twitter.com/nickmuchi)
|
@@ -143,7 +144,8 @@ with demo:
|
|
143 |
img_output_from_url = gr.Image(shape=(750,750))
|
144 |
|
145 |
with gr.Row():
|
146 |
-
example_url = gr.
|
|
|
147 |
|
148 |
url_but = gr.Button('Detect')
|
149 |
|
@@ -153,8 +155,7 @@ with demo:
|
|
153 |
img_output_from_upload= gr.Image(shape=(750,750))
|
154 |
|
155 |
with gr.Row():
|
156 |
-
example_images = gr.
|
157 |
-
samples=[[path.as_posix()] for path in sorted(pathlib.Path('images').rglob('*.j*g'))])
|
158 |
|
159 |
|
160 |
img_but = gr.Button('Detect')
|
@@ -169,9 +170,6 @@ with demo:
|
|
169 |
url_but.click(detect_objects,inputs=[options,url_input,img_input,web_input,slider_input],outputs=[img_output_from_url],queue=True)
|
170 |
img_but.click(detect_objects,inputs=[options,url_input,img_input,web_input,slider_input],outputs=[img_output_from_upload],queue=True)
|
171 |
cam_but.click(detect_objects,inputs=[options,url_input,img_input,web_input,slider_input],outputs=[img_output_from_webcam],queue=True)
|
172 |
-
example_images.click(fn=set_example_image,inputs=[example_images],outputs=[img_input])
|
173 |
-
example_url.click(fn=set_example_url,inputs=[example_url],outputs=[url_input,original_image])
|
174 |
-
|
175 |
|
176 |
gr.Markdown("![visitor badge](https://visitor-badge.glitch.me/badge?page_id=nickmuchi-license-plate-detection-with-yolos)")
|
177 |
|
|
|
113 |
|
114 |
models = ["nickmuchi/yolos-small-rego-plates-detection","nickmuchi/yolos-small-license-plate-detection"]
|
115 |
urls = ["https://drive.google.com/uc?id=1j9VZQ4NDS4gsubFf3m2qQoTMWLk552bQ","https://drive.google.com/uc?id=1p9wJIqRz3W50e2f_A0D8ftla8hoXz4T5"]
|
116 |
+
images = [[path.as_posix()] for path in sorted(pathlib.Path('images').rglob('*.j*g'))]
|
117 |
|
118 |
twitter_link = """
|
119 |
[![](https://img.shields.io/twitter/follow/nickmuchi?label=@nickmuchi&style=social)](https://twitter.com/nickmuchi)
|
|
|
144 |
img_output_from_url = gr.Image(shape=(750,750))
|
145 |
|
146 |
with gr.Row():
|
147 |
+
example_url = gr.Examples(examples=urls,inputs=[url_input])
|
148 |
+
|
149 |
|
150 |
url_but = gr.Button('Detect')
|
151 |
|
|
|
155 |
img_output_from_upload= gr.Image(shape=(750,750))
|
156 |
|
157 |
with gr.Row():
|
158 |
+
example_images = gr.Examples(examples=images,inputs=[img_input])
|
|
|
159 |
|
160 |
|
161 |
img_but = gr.Button('Detect')
|
|
|
170 |
url_but.click(detect_objects,inputs=[options,url_input,img_input,web_input,slider_input],outputs=[img_output_from_url],queue=True)
|
171 |
img_but.click(detect_objects,inputs=[options,url_input,img_input,web_input,slider_input],outputs=[img_output_from_upload],queue=True)
|
172 |
cam_but.click(detect_objects,inputs=[options,url_input,img_input,web_input,slider_input],outputs=[img_output_from_webcam],queue=True)
|
|
|
|
|
|
|
173 |
|
174 |
gr.Markdown("![visitor badge](https://visitor-badge.glitch.me/badge?page_id=nickmuchi-license-plate-detection-with-yolos)")
|
175 |
|