tbelvin5969 commited on
Commit
bd7f4bb
·
verified ·
1 Parent(s): 3bdd3d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -12
app.py CHANGED
@@ -1,16 +1,10 @@
1
  import gradio as gr
2
- from PIL import Image
3
 
4
- def detect_insect(image):
5
- # Your actual model inference code goes here
6
- result = "Detected insect: Example species"
7
- return result
8
 
9
- iface = gr.Interface(
10
- fn=detect_insect,
11
- inputs=gr.Image(type="pil"),
12
- outputs="text",
13
- title="Insect Detector"
14
- )
15
 
16
- iface.launch() # Do not put this inside "if __name__ == '__main__'"
 
 
1
  import gradio as gr
 
2
 
3
+ def predict(image):
4
+ # Replace with your model inference code
5
+ return "Insect detected: Example species"
 
6
 
7
+ iface = gr.Interface(fn=predict, inputs=gr.Image(type="pil"), outputs="text")
 
 
 
 
 
8
 
9
+ if __name__ == "__main__":
10
+ iface.launch()