Spaces:
Runtime error
Runtime error
Commit
·
223c057
1
Parent(s):
c8e1994
Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,10 @@ path = Path()
|
|
4 |
path.ls(file_exts='.pkl')
|
5 |
learn_inf = load_learner(path/'export.pkl')
|
6 |
labels = learn_inf.dls.vocab
|
7 |
-
def on_click_classify(
|
8 |
-
img = PILImage.create(
|
9 |
pred,pred_idx,probs = learn_inf.predict(img)
|
10 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
11 |
import gradio as gr
|
12 |
-
|
|
|
|
4 |
path.ls(file_exts='.pkl')
|
5 |
learn_inf = load_learner(path/'export.pkl')
|
6 |
labels = learn_inf.dls.vocab
|
7 |
+
def on_click_classify(imgage):
|
8 |
+
img = PILImage.create(image)
|
9 |
pred,pred_idx,probs = learn_inf.predict(img)
|
10 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
11 |
import gradio as gr
|
12 |
+
title = "Classify a Bear! Check if it is a grizzly, black or teddy bear! "
|
13 |
+
gr.Interface(fn=on_click_classify, inputs=gr.Image(), outputs=gr.Label(num_top_classes=3), title=title).launch(share=True)
|