Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from PIL import Image
|
|
4 |
|
5 |
# Load the exported fastai Learner
|
6 |
learn = load_learner('model.pkl')
|
7 |
-
labels = learn.dls.vocab #
|
8 |
|
9 |
# Prediction function
|
10 |
def predict(img):
|
@@ -21,11 +21,10 @@ examples = ['shark.jpg', 'bird.jpg']
|
|
21 |
# Launch the Gradio interface
|
22 |
gr.Interface(
|
23 |
fn=predict,
|
24 |
-
inputs=gr.Image(type="pil"),
|
25 |
outputs=gr.Label(num_top_classes=2),
|
26 |
title=title,
|
27 |
description=description,
|
28 |
examples=examples,
|
29 |
-
interpretation='default',
|
30 |
allow_flagging='never'
|
31 |
).launch()
|
|
|
4 |
|
5 |
# Load the exported fastai Learner
|
6 |
learn = load_learner('model.pkl')
|
7 |
+
labels = learn.dls.vocab # ['bird', 'shark']
|
8 |
|
9 |
# Prediction function
|
10 |
def predict(img):
|
|
|
21 |
# Launch the Gradio interface
|
22 |
gr.Interface(
|
23 |
fn=predict,
|
24 |
+
inputs=gr.Image(type="pil"),
|
25 |
outputs=gr.Label(num_top_classes=2),
|
26 |
title=title,
|
27 |
description=description,
|
28 |
examples=examples,
|
|
|
29 |
allow_flagging='never'
|
30 |
).launch()
|