MariusWenk
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -2,15 +2,15 @@ import gradio as gr
|
|
2 |
from fastai.vision.all import *
|
3 |
import skimage
|
4 |
|
5 |
-
learn = load_learner('
|
6 |
|
7 |
labels = learn.dls.vocab
|
8 |
def predict(img):
|
9 |
pred,pred_idx,probs = learn.predict(img)
|
10 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
11 |
|
12 |
-
title = "
|
13 |
-
description = "A
|
14 |
article="<p style='text-align: center'><a href='https://tmabraham.github.io/blog/gradio_hf_spaces_tutorial' target='_blank'>Blog post</a></p>"
|
15 |
examples = ['persian.jpg']
|
16 |
|
|
|
2 |
from fastai.vision.all import *
|
3 |
import skimage
|
4 |
|
5 |
+
learn = load_learner('pet_model.pkl')
|
6 |
|
7 |
labels = learn.dls.vocab
|
8 |
def predict(img):
|
9 |
pred,pred_idx,probs = learn.predict(img)
|
10 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
11 |
|
12 |
+
title = "Pet Breed Classifier"
|
13 |
+
description = "A pet breed classifier trained on the Oxford Pets dataset with fastai. Created as a demo for Gradio and HuggingFace Spaces, based on the blog post below."
|
14 |
article="<p style='text-align: center'><a href='https://tmabraham.github.io/blog/gradio_hf_spaces_tutorial' target='_blank'>Blog post</a></p>"
|
15 |
examples = ['persian.jpg']
|
16 |
|