Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- app.py +7 -3
- tree-classifier.pkl +3 -0
app.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
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
|