Spaces:
Sleeping
Sleeping
Benjamin Coman
commited on
Commit
•
393d6df
1
Parent(s):
7469cf1
app.py fix indentation
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ learn = load_learner('watersports.pkl')
|
|
5 |
categories = learn.dls.vocab
|
6 |
|
7 |
def classify_image(img):
|
8 |
-
|
9 |
-
|
10 |
|
11 |
title = "Which Watersport?"
|
12 |
description = "Drag an image into the analyser. Try to guess the water sport yourself, before hitting submit. \
|
|
|
5 |
categories = learn.dls.vocab
|
6 |
|
7 |
def classify_image(img):
|
8 |
+
pred,idx,probs = learn.predict(img)
|
9 |
+
return( dict(zip(categories, map(float,probs))))
|
10 |
|
11 |
title = "Which Watersport?"
|
12 |
description = "Drag an image into the analyser. Try to guess the water sport yourself, before hitting submit. \
|