Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
import gradio
|
2 |
from fastai.vision.all import *
|
3 |
|
4 |
-
|
5 |
|
6 |
labels = learn.dls.vocab
|
7 |
|
8 |
def predict(img):
|
9 |
pred,idx,probs = learn.predict(img)
|
10 |
-
return {labels[i]: float(probs[i]) for i,_ in
|
11 |
|
12 |
-
image = gr.inputs.Image(shape(256,256))
|
13 |
label = gr.outputs.Label()
|
14 |
examples = ['house1.jpg','house2.jpg','house3.jpg','house4.jpg','house5.jpg']
|
15 |
|
|
|
1 |
import gradio
|
2 |
from fastai.vision.all import *
|
3 |
|
4 |
+
learn = load_learner('model.pkl')
|
5 |
|
6 |
labels = learn.dls.vocab
|
7 |
|
8 |
def predict(img):
|
9 |
pred,idx,probs = learn.predict(img)
|
10 |
+
return {labels[i]: float(probs[i]) for i,_ in enumerate(labels))}
|
11 |
|
12 |
+
image = gr.inputs.Image(shape=(256,256))
|
13 |
label = gr.outputs.Label()
|
14 |
examples = ['house1.jpg','house2.jpg','house3.jpg','house4.jpg','house5.jpg']
|
15 |
|