Spaces:
Runtime error
Runtime error
Ilija Eftimov
commited on
Commit
·
557cdf9
1
Parent(s):
2082fc6
Changes example images structure and contents
Browse files- app.py +2 -6
- examples/Pappardelle.jpg +0 -0
- campanelle/1.jpg → examples/campanelle-1.jpg +0 -0
- campanelle/2.jpg → examples/campanelle-2.jpg +0 -0
- campanelle/3.jpg → examples/campanelle-3.jpg +0 -0
- examples/ditalini.jpg +0 -0
- examples/fettuccine.jpg +0 -0
- fusilli/1.jpg → examples/fusilli-1.jpg +0 -0
- fusilli/2.jpg → examples/fusilli-2.jpg +0 -0
- fusilli/3.jpg → examples/fusilli-3.jpg +0 -0
- macaroni/1.jpg → examples/macaroni-1.jpg +0 -0
- macaroni/2.jpg → examples/macaroni-2.jpg +0 -0
- macaroni/3.jpg → examples/macaroni-3.jpg +0 -0
- examples/parpardelle.jpg +0 -0
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
|
|
3 |
|
|
|
4 |
learn = load_learner("model.pkl")
|
5 |
|
6 |
labels = learn.dls.vocab
|
@@ -10,12 +12,6 @@ def classify_image(img):
|
|
10 |
image = gr.inputs.Image(shape=(192,192))
|
11 |
label = gr.outputs.Label()
|
12 |
|
13 |
-
examples = []
|
14 |
-
for n in range(1,4):
|
15 |
-
examples.append(f"campanelle/{n}.jpg")
|
16 |
-
examples.append(f"macaroni/{n}.jpg")
|
17 |
-
examples.append(f"fusilli/{n}.jpg")
|
18 |
-
|
19 |
title = "Pasta Recognition"
|
20 |
|
21 |
description = """
|
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
+
import glob
|
4 |
|
5 |
+
examples = glob.glob("examples/*")
|
6 |
learn = load_learner("model.pkl")
|
7 |
|
8 |
labels = learn.dls.vocab
|
|
|
12 |
image = gr.inputs.Image(shape=(192,192))
|
13 |
label = gr.outputs.Label()
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
title = "Pasta Recognition"
|
16 |
|
17 |
description = """
|
examples/Pappardelle.jpg
ADDED
![]() |
campanelle/1.jpg → examples/campanelle-1.jpg
RENAMED
File without changes
|
campanelle/2.jpg → examples/campanelle-2.jpg
RENAMED
File without changes
|
campanelle/3.jpg → examples/campanelle-3.jpg
RENAMED
File without changes
|
examples/ditalini.jpg
ADDED
![]() |
examples/fettuccine.jpg
ADDED
![]() |
fusilli/1.jpg → examples/fusilli-1.jpg
RENAMED
File without changes
|
fusilli/2.jpg → examples/fusilli-2.jpg
RENAMED
File without changes
|
fusilli/3.jpg → examples/fusilli-3.jpg
RENAMED
File without changes
|
macaroni/1.jpg → examples/macaroni-1.jpg
RENAMED
File without changes
|
macaroni/2.jpg → examples/macaroni-2.jpg
RENAMED
File without changes
|
macaroni/3.jpg → examples/macaroni-3.jpg
RENAMED
File without changes
|
examples/parpardelle.jpg
ADDED
![]() |