Spaces:
Runtime error
Runtime error
updated app file
Browse files
app.py
CHANGED
@@ -10,13 +10,17 @@ learn = load_learner('model.pkl')
|
|
10 |
|
11 |
#|export
|
12 |
categories = ('Dog', 'Cat')
|
|
|
13 |
def classify_image(im):
|
14 |
pred, idx, probs = learn.predict(im)
|
15 |
return dict(zip(categories, map(float, probs)))
|
16 |
|
17 |
#|export
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
def classify_image(im):
|
21 |
-
pred, idx, probs = learn.predict(im)
|
22 |
-
return dict(zip(categories, map(float, probs)))
|
|
|
10 |
|
11 |
#|export
|
12 |
categories = ('Dog', 'Cat')
|
13 |
+
|
14 |
def classify_image(im):
|
15 |
pred, idx, probs = learn.predict(im)
|
16 |
return dict(zip(categories, map(float, probs)))
|
17 |
|
18 |
#|export
|
19 |
+
image = gr.inputs.Image(shape=(192,192))
|
20 |
+
label = gr.outputs.Label()
|
21 |
+
examples = ['dog.jpg', 'cat.jpg']
|
22 |
+
|
23 |
+
intf = gr.Interface(fn=classify_image, inputs = image, outputs =label, examples = examples)
|
24 |
+
intf.launch(inline=False)
|
25 |
+
|
26 |
|
|
|
|
|
|