Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,11 +5,11 @@ def which_player(x): return x[0].isupper()
|
|
5 |
|
6 |
learn = load_learner('model.pkl')
|
7 |
|
8 |
-
categories =
|
9 |
|
10 |
def classify_image(img):
|
11 |
pred, ids, probs = learn.predict(img)
|
12 |
-
return dict(zip(
|
13 |
|
14 |
image = gr.inputs.Image(shape=(192, 192))
|
15 |
label = gr.outputs.Label()
|
|
|
5 |
|
6 |
learn = load_learner('model.pkl')
|
7 |
|
8 |
+
categories = learn.dls.vocab
|
9 |
|
10 |
def classify_image(img):
|
11 |
pred, ids, probs = learn.predict(img)
|
12 |
+
return dict(zip(categories, map(float, probs)))
|
13 |
|
14 |
image = gr.inputs.Image(shape=(192, 192))
|
15 |
label = gr.outputs.Label()
|