Spaces:
Runtime error
Runtime error
#add title
Browse files
app.py
CHANGED
@@ -3,19 +3,25 @@ from fastai.vision.all import *
|
|
3 |
|
4 |
learn = load_learner("first_model.pkl")
|
5 |
|
6 |
-
categories = ["Suisei", "Toko"]
|
7 |
|
8 |
|
9 |
def classify_img(img):
|
10 |
-
|
11 |
pred, idx, probs = learn.predict(img)
|
12 |
return dict(zip(categories, map(float, probs)))
|
13 |
|
14 |
|
15 |
-
image = gr.inputs.Image(shape=(
|
16 |
label = gr.outputs.Label()
|
17 |
examples = ["suiseicz.png", "tokocz.jpg"]
|
18 |
|
|
|
19 |
|
20 |
-
iface = gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
iface.launch(inline=False)
|
|
|
3 |
|
4 |
learn = load_learner("first_model.pkl")
|
5 |
|
6 |
+
categories = ["Hoshimachi Suisei", "Inui Toko"]
|
7 |
|
8 |
|
9 |
def classify_img(img):
|
|
|
10 |
pred, idx, probs = learn.predict(img)
|
11 |
return dict(zip(categories, map(float, probs)))
|
12 |
|
13 |
|
14 |
+
image = gr.inputs.Image(shape=(128, 128))
|
15 |
label = gr.outputs.Label()
|
16 |
examples = ["suiseicz.png", "tokocz.jpg"]
|
17 |
|
18 |
+
title = "Toko and Suisei classifier"
|
19 |
|
20 |
+
iface = gr.Interface(
|
21 |
+
fn=classify_img,
|
22 |
+
inputs=image,
|
23 |
+
outputs=label,
|
24 |
+
examples=examples,
|
25 |
+
title=title,
|
26 |
+
)
|
27 |
iface.launch(inline=False)
|