DanielV
commited on
Commit
·
6790977
1
Parent(s):
dbb8979
updated app (2)
Browse files
app.py
CHANGED
@@ -3,10 +3,6 @@ from fastai.learner import load_learner
|
|
3 |
from PIL import Image
|
4 |
import gradio as gr
|
5 |
|
6 |
-
image = Image.open("examples/riku.jpg")
|
7 |
-
image.thumbnail((512,512))
|
8 |
-
image
|
9 |
-
|
10 |
learn = load_learner("model.pkl")
|
11 |
categories = list(learn.dls.vocab)
|
12 |
|
@@ -15,8 +11,6 @@ def classify_image(img):
|
|
15 |
pred, ix, probs = learn.predict(img)
|
16 |
return dict(zip(categories, map(float, probs)))
|
17 |
|
18 |
-
print(classify_image(image))
|
19 |
-
|
20 |
# Whats the gradio input type? Image
|
21 |
image = gr.inputs.Image(shape=(192,192))
|
22 |
# Whats the gradio output type? Label
|
|
|
3 |
from PIL import Image
|
4 |
import gradio as gr
|
5 |
|
|
|
|
|
|
|
|
|
6 |
learn = load_learner("model.pkl")
|
7 |
categories = list(learn.dls.vocab)
|
8 |
|
|
|
11 |
pred, ix, probs = learn.predict(img)
|
12 |
return dict(zip(categories, map(float, probs)))
|
13 |
|
|
|
|
|
14 |
# Whats the gradio input type? Image
|
15 |
image = gr.inputs.Image(shape=(192,192))
|
16 |
# Whats the gradio output type? Label
|