MuGeminorum commited on
Commit
d59d689
1 Parent(s): 4abe101

add examples

Browse files
Files changed (3) hide show
  1. app.py +7 -19
  2. examples/beetle.jpg +0 -0
  3. examples/butterfly.jpg +0 -0
app.py CHANGED
@@ -107,23 +107,11 @@ download_model(
107
  "./insectid/models/quarrying_insect_identifier.onnx"
108
  )
109
 
110
- with gr.Blocks() as demo:
111
- with gr.Tab("Image"):
112
- gr.Markdown("## Insect Inference on Image")
113
- with gr.Row():
114
- image_input = gr.Image(
115
- type='filepath',
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
- demo.launch()
 
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