Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import gradio as gr
|
|
4 |
def is_cat(x): return x[0].isupper()
|
5 |
|
6 |
learn=load_learner('export.pkl')
|
7 |
-
categories = ('
|
8 |
def classify_image(img):
|
9 |
pred,idx,confidence = learn.predict(img)
|
10 |
return dict(zip(categories,map(float,confidence)))
|
@@ -13,6 +13,6 @@ def classify_image(img):
|
|
13 |
|
14 |
image = gr.inputs.Image(shape=(192,192))
|
15 |
label = gr.outputs.Label()
|
16 |
-
examples = ['
|
17 |
intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
|
18 |
intf.launch(share=True)
|
|
|
4 |
def is_cat(x): return x[0].isupper()
|
5 |
|
6 |
learn=load_learner('export.pkl')
|
7 |
+
categories = ('grizzly','black','teddy')
|
8 |
def classify_image(img):
|
9 |
pred,idx,confidence = learn.predict(img)
|
10 |
return dict(zip(categories,map(float,confidence)))
|
|
|
13 |
|
14 |
image = gr.inputs.Image(shape=(192,192))
|
15 |
label = gr.outputs.Label()
|
16 |
+
examples = ['black.jpg','grizzly.jpg','teddy.jpg']
|
17 |
intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
|
18 |
intf.launch(share=True)
|