Spaces:
Runtime error
Runtime error
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from fastai.vision.all import *
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
repo_id = "codingmoh/cat-breed-identifier"
|
| 7 |
-
|
| 8 |
-
learn = from_pretrained_fastai(repo_id)
|
| 9 |
|
| 10 |
labels = learn.dls.vocab
|
| 11 |
def predict(img):
|
|
@@ -18,4 +15,4 @@ description = "A pet breed classifier trained on the Oxford Pets dataset with fa
|
|
| 18 |
interpretation='default'
|
| 19 |
enable_queue=True
|
| 20 |
|
| 21 |
-
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,interpretation=interpretation,enable_queue=enable_queue).launch()
|
|
|
|
| 1 |
+
|
| 2 |
import gradio as gr
|
| 3 |
from fastai.vision.all import *
|
| 4 |
|
| 5 |
+
learn = load_learner('model.pkl')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
labels = learn.dls.vocab
|
| 8 |
def predict(img):
|
|
|
|
| 15 |
interpretation='default'
|
| 16 |
enable_queue=True
|
| 17 |
|
| 18 |
+
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch()
|