Spaces:
Running
Running
MuGeminorum
commited on
Commit
•
d59d689
1
Parent(s):
4abe101
add examples
Browse files- app.py +7 -19
- examples/beetle.jpg +0 -0
- examples/butterfly.jpg +0 -0
app.py
CHANGED
@@ -107,23 +107,11 @@ download_model(
|
|
107 |
"./insectid/models/quarrying_insect_identifier.onnx"
|
108 |
)
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
label="Input Image"
|
117 |
-
)
|
118 |
-
|
119 |
-
image_output = gr.Image(
|
120 |
-
type='pil',
|
121 |
-
label="Output Image"
|
122 |
-
)
|
123 |
-
|
124 |
-
text_button = gr.Button("Detect")
|
125 |
-
|
126 |
-
text_button.click(inference, inputs=image_input, outputs=image_output)
|
127 |
-
|
128 |
|
129 |
-
|
|
|
107 |
"./insectid/models/quarrying_insect_identifier.onnx"
|
108 |
)
|
109 |
|
110 |
+
iface = gr.Interface(
|
111 |
+
fn=inference,
|
112 |
+
inputs=gr.Image(label='Upload insect photo', type='filepath'),
|
113 |
+
outputs=gr.Image(label='Detection result'),
|
114 |
+
examples=['./examples/butterfly.jpg', './examples/beetle.jpg']
|
115 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
iface.launch()
|
examples/beetle.jpg
ADDED
examples/butterfly.jpg
ADDED