Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,8 @@ from fastai.vision.all import *
|
|
2 |
import gradio as gr
|
3 |
learner = load_learner('export.pkl')
|
4 |
|
5 |
-
|
|
|
6 |
labels = learner.dls.vocab
|
7 |
|
8 |
def predict(img):
|
@@ -11,7 +12,7 @@ def predict(img):
|
|
11 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
12 |
|
13 |
|
14 |
-
examples = ['1.jpg', '2.jpg', '3.jpg']
|
15 |
|
16 |
|
17 |
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(224, 224)), outputs=gr.outputs.Label(num_top_classes=3), examples=examples).launch(share=True, debug=True)
|
|
|
2 |
import gradio as gr
|
3 |
learner = load_learner('export.pkl')
|
4 |
|
5 |
+
title = "Bird Species Classifier"
|
6 |
+
description = "A bird species classifier trained on the BIRDS 400 dataset from Kaggle with fastai. Created as a demo for Gradio and HuggingFace Spaces."
|
7 |
labels = learner.dls.vocab
|
8 |
|
9 |
def predict(img):
|
|
|
12 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
13 |
|
14 |
|
15 |
+
examples = ['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg', '8.jpg', '9.jpg', '10.jpg', '11.jpg', '12.jpg', '13.jpg', '14.jpg', '15.jpg']
|
16 |
|
17 |
|
18 |
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(224, 224)), outputs=gr.outputs.Label(num_top_classes=3), examples=examples).launch(share=True, debug=True)
|