eclfe commited on
Commit
c657600
·
verified ·
1 Parent(s): 6057f8d

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -17
app.py DELETED
@@ -1,17 +0,0 @@
1
- import gradio as gr
2
- from fastai.vision.all import *
3
-
4
- learn = load_learner('model.pkl')
5
-
6
- labels = learn.dls.vocab
7
- def predict(img):
8
- img = PILImage.create(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."
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
- enable_queue=True
16
-
17
- gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch()