Spaces:
Sleeping
Sleeping
Trever J
commited on
Commit
·
53505fb
1
Parent(s):
33334ba
add categories
Browse files
app.py
CHANGED
@@ -4,10 +4,10 @@ import gradio as gr
|
|
4 |
def is_cat(x): return x[0].isupper()
|
5 |
|
6 |
learn = load_learner('model.pkl')
|
7 |
-
|
8 |
def classify_image(img):
|
9 |
pred,idx,probs = learn.predict(img)
|
10 |
-
return dict(zip(categories, map(float,
|
11 |
|
12 |
image = gr.inputs.Image(shape=(192,192))
|
13 |
label = gr.outputs.Label()
|
|
|
4 |
def is_cat(x): return x[0].isupper()
|
5 |
|
6 |
learn = load_learner('model.pkl')
|
7 |
+
categories = ('Dog', 'Cat')
|
8 |
def classify_image(img):
|
9 |
pred,idx,probs = learn.predict(img)
|
10 |
+
return dict(zip(categories, map(float, probs)))
|
11 |
|
12 |
image = gr.inputs.Image(shape=(192,192))
|
13 |
label = gr.outputs.Label()
|