Spaces:
Runtime error
Runtime error
Commit ·
452886e
1
Parent(s): 9617ea9
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,9 @@ __all__ = ['learn', 'classify_image', 'categories', 'image', 'label', 'intf']
|
|
| 3 |
from fastai.vision.all import *
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
-
learn = load_learner('export.pkl')
|
| 7 |
|
| 8 |
-
categories = ('Dog Destroying Stuff','
|
| 9 |
def classify_image(img):
|
| 10 |
pred, idx, probs = learn.predict(img)
|
| 11 |
return dict(zip(categories, map(float, probs)))
|
|
@@ -13,4 +13,4 @@ def classify_image(img):
|
|
| 13 |
image=gr.Image()
|
| 14 |
label = gr.Label()
|
| 15 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
| 16 |
-
intf.launch()
|
|
|
|
| 3 |
from fastai.vision.all import *
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
+
learn = load_learner('export (3).pkl')
|
| 7 |
|
| 8 |
+
categories = ('Dog Destroying Stuff','Neutral')
|
| 9 |
def classify_image(img):
|
| 10 |
pred, idx, probs = learn.predict(img)
|
| 11 |
return dict(zip(categories, map(float, probs)))
|
|
|
|
| 13 |
image=gr.Image()
|
| 14 |
label = gr.Label()
|
| 15 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
| 16 |
+
intf.launch()
|