DanielV
commited on
Commit
•
c4849ec
1
Parent(s):
6790977
updated app (3)
Browse files
app.py
CHANGED
@@ -2,8 +2,9 @@ from fastai.vision import *
|
|
2 |
from fastai.learner import load_learner
|
3 |
from PIL import Image
|
4 |
import gradio as gr
|
|
|
5 |
|
6 |
-
learn = load_learner("model.pkl")
|
7 |
categories = list(learn.dls.vocab)
|
8 |
|
9 |
|
@@ -16,7 +17,7 @@ image = gr.inputs.Image(shape=(192,192))
|
|
16 |
# Whats the gradio output type? Label
|
17 |
label = gr.outputs.Label()
|
18 |
# Set up some examples
|
19 |
-
examples = ["examples/kairi.jpg", "examples/riku.jpg", "examples/sora.jpg"]
|
20 |
|
21 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
22 |
intf.launch(inline=False)
|
|
|
2 |
from fastai.learner import load_learner
|
3 |
from PIL import Image
|
4 |
import gradio as gr
|
5 |
+
from pathlib import Path
|
6 |
|
7 |
+
learn = load_learner(Path("model.pkl"))
|
8 |
categories = list(learn.dls.vocab)
|
9 |
|
10 |
|
|
|
17 |
# Whats the gradio output type? Label
|
18 |
label = gr.outputs.Label()
|
19 |
# Set up some examples
|
20 |
+
examples = [Path("examples/kairi.jpg"), Path("examples/riku.jpg"), Path("examples/sora.jpg")]
|
21 |
|
22 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
23 |
intf.launch(inline=False)
|