Spaces:
Runtime error
Runtime error
jonathan-roos
commited on
Commit
•
0462897
1
Parent(s):
e88eb2f
added explicit categories before classify_bats call
Browse files
app.py
CHANGED
@@ -3,9 +3,11 @@ import gradio as gr
|
|
3 |
|
4 |
learn = load_learner('model.pkl')
|
5 |
|
|
|
|
|
6 |
def classify_bat(img):
|
7 |
-
label,_,probs = learn.predict(img)
|
8 |
-
return dict(zip(
|
9 |
|
10 |
image = gr.inputs.Image(shape=(200, 200))
|
11 |
label = gr.outputs.Label()
|
|
|
3 |
|
4 |
learn = load_learner('model.pkl')
|
5 |
|
6 |
+
categories = ('!bat', 'bat')
|
7 |
+
|
8 |
def classify_bat(img):
|
9 |
+
label,_,probs = learn.predict(img)
|
10 |
+
return dict(zip(categories, map(float, probs)))
|
11 |
|
12 |
image = gr.inputs.Image(shape=(200, 200))
|
13 |
label = gr.outputs.Label()
|