Daniel-123 commited on
Commit
8819004
·
verified ·
1 Parent(s): 091d51a

Upload 3 files

Browse files
Files changed (2) hide show
  1. app.py +7 -3
  2. tree-classifier.pkl +3 -0
app.py CHANGED
@@ -1,7 +1,11 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
7
  iface.launch()
 
1
  import gradio as gr
2
+ from fastai.vision.all import *
3
 
4
+ learn = load_learner('./tree-classifier.pkl')
 
5
 
6
+ def predict(image):
7
+ leaf_type,_,probs = learn.predict(image)
8
+ return f"This is a: {leaf_type}. \nProbability it's a {leaf_type}: {probs.max():.4f}"
9
+
10
+ iface = gr.Interface(fn=predict, inputs="image", outputs="text")
11
  iface.launch()
tree-classifier.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ef961246dbbf27f9b51965bf601808e50bc757ad47d371cba6948c30792f56f
3
+ size 46966279