Spaces:
Runtime error
Runtime error
Commit
·
9b8e51b
1
Parent(s):
ac04cbe
yes
Browse files
app.py
CHANGED
|
@@ -10,19 +10,12 @@ import gradio as gr
|
|
| 10 |
|
| 11 |
learn = load_learner(Path("model.pkl"))
|
| 12 |
|
| 13 |
-
categories = {'Pizza', 'Pasta'}
|
| 14 |
-
|
| 15 |
def classify_image(img):
|
| 16 |
pred, idx, probs = learn.predict(img)
|
| 17 |
-
# print(pred)
|
| 18 |
-
# print(idx)
|
| 19 |
-
# print(dict(zip(categories, map(float, probs))))
|
| 20 |
return f"This is {pred}.\nConfidence Level: {float(max(probs))}"
|
| 21 |
-
# return dict(zip(categories, map(float, probs)))
|
| 22 |
|
| 23 |
|
| 24 |
image = gr.Image(shape=(192, 192))
|
| 25 |
-
label = gr.Label()
|
| 26 |
examples = ['pizza.jpg', 'pasta.jpg', 'dunno.jpg']
|
| 27 |
|
| 28 |
app = gr.Interface(fn=classify_image,
|
|
|
|
| 10 |
|
| 11 |
learn = load_learner(Path("model.pkl"))
|
| 12 |
|
|
|
|
|
|
|
| 13 |
def classify_image(img):
|
| 14 |
pred, idx, probs = learn.predict(img)
|
|
|
|
|
|
|
|
|
|
| 15 |
return f"This is {pred}.\nConfidence Level: {float(max(probs))}"
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
image = gr.Image(shape=(192, 192))
|
|
|
|
| 19 |
examples = ['pizza.jpg', 'pasta.jpg', 'dunno.jpg']
|
| 20 |
|
| 21 |
app = gr.Interface(fn=classify_image,
|