Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,12 +12,13 @@ def dummy():
|
|
12 |
return "ABC"
|
13 |
|
14 |
def predict(image):
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
gr.Interface(
|
19 |
predict,
|
20 |
inputs=gr.inputs.Image(label="candidate", type="filepath"),
|
21 |
-
outputs=
|
22 |
title="Snail? Snake? Slug?",
|
23 |
).launch()
|
|
|
12 |
return "ABC"
|
13 |
|
14 |
def predict(image):
|
15 |
+
label, index, scores = learner.predict(image)
|
16 |
+
|
17 |
+
return {l: scores[i].item() for i,l in enumerate(learner.dls.vocab)}
|
18 |
|
19 |
gr.Interface(
|
20 |
predict,
|
21 |
inputs=gr.inputs.Image(label="candidate", type="filepath"),
|
22 |
+
outputs=gr.outputs.Label(num_top_classes=3),
|
23 |
title="Snail? Snake? Slug?",
|
24 |
).launch()
|