Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,10 +12,16 @@ def predict(image):
|
|
12 |
label, index, scores = learner.predict(image)
|
13 |
|
14 |
return {l: scores[i].item() for i,l in enumerate(learner.dls.vocab)}
|
|
|
|
|
|
|
|
|
15 |
|
16 |
gr.Interface(
|
17 |
predict,
|
18 |
inputs=gr.inputs.Image(label="candidate", type="filepath"),
|
19 |
outputs=gr.outputs.Label(num_top_classes=3),
|
20 |
-
title=
|
21 |
-
|
|
|
|
|
|
12 |
label, index, scores = learner.predict(image)
|
13 |
|
14 |
return {l: scores[i].item() for i,l in enumerate(learner.dls.vocab)}
|
15 |
+
title = "Snail, snake, slug Classifier"
|
16 |
+
description = "A classifier trained on about 300 images. Created as a demo for Gradio and HuggingFace Spaces."
|
17 |
+
examples = ['slug_1.jpg']
|
18 |
+
|
19 |
|
20 |
gr.Interface(
|
21 |
predict,
|
22 |
inputs=gr.inputs.Image(label="candidate", type="filepath"),
|
23 |
outputs=gr.outputs.Label(num_top_classes=3),
|
24 |
+
title=title,
|
25 |
+
examples=examples,
|
26 |
+
description=description,
|
27 |
+
).launch()
|