Spaces:
Runtime error
Runtime error
remove version of gradio and use up to date interface
Browse files- app.py +3 -4
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -3,8 +3,8 @@ from fastai.vision.all import *
|
|
| 3 |
|
| 4 |
learn = load_learner('model.pkl')
|
| 5 |
|
| 6 |
-
image = gr.
|
| 7 |
-
label = gr.
|
| 8 |
examples = ['grizzly.jpg', 'black-bear.jpg', 'teddy-bear.jpg']
|
| 9 |
|
| 10 |
categories = ('Grizzly Bear', 'Black Bear', 'Teddy Bear')
|
|
@@ -13,6 +13,5 @@ def classify_image(img):
|
|
| 13 |
pred, idx, probs = learn.predict(img)
|
| 14 |
return dict(zip(categories, map(float, probs)))
|
| 15 |
|
| 16 |
-
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label
|
| 17 |
intf.launch(inline=False)
|
| 18 |
-
|
|
|
|
| 3 |
|
| 4 |
learn = load_learner('model.pkl')
|
| 5 |
|
| 6 |
+
image = gr.Image(type='pil', height=192, width=192)
|
| 7 |
+
label = gr.Label()
|
| 8 |
examples = ['grizzly.jpg', 'black-bear.jpg', 'teddy-bear.jpg']
|
| 9 |
|
| 10 |
categories = ('Grizzly Bear', 'Black Bear', 'Teddy Bear')
|
|
|
|
| 13 |
pred, idx, probs = learn.predict(img)
|
| 14 |
return dict(zip(categories, map(float, probs)))
|
| 15 |
|
| 16 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
| 17 |
intf.launch(inline=False)
|
|
|
requirements.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
gradio
|
| 2 |
fastai
|
|
|
|
| 1 |
+
gradio
|
| 2 |
fastai
|