dl4
Browse files- app.py +2 -2
- dragon.jpeg +0 -0
- green.jpeg +0 -0
- lemon.webp +0 -0
- orange.jpeg +0 -0
- yellow.jpeg +0 -0
app.py
CHANGED
@@ -2,14 +2,14 @@ import gradio as gr
|
|
2 |
from fastai.vision.all import *
|
3 |
|
4 |
learn = load_learner('export.pkl')
|
5 |
-
categories = ('Lemon', 'Orange','dragon fruit', '
|
6 |
def classify_image(img):
|
7 |
pred, idx, probs = learn.predict(img)
|
8 |
return dict(zip(categories, map(float, probs)))
|
9 |
|
10 |
image = gr.inputs.Image(shape = (256, 256))
|
11 |
label = gr.outputs.Label()
|
12 |
-
examples = ['apple.jpeg']
|
13 |
|
14 |
intf = gr.Interface(fn = classify_image, inputs=image, outputs=label, examples=examples)
|
15 |
intf.launch()
|
|
|
2 |
from fastai.vision.all import *
|
3 |
|
4 |
learn = load_learner('export.pkl')
|
5 |
+
categories = ('Lemon', 'Orange','dragon fruit', 'green apple', 'red apple', 'yellow apple')
|
6 |
def classify_image(img):
|
7 |
pred, idx, probs = learn.predict(img)
|
8 |
return dict(zip(categories, map(float, probs)))
|
9 |
|
10 |
image = gr.inputs.Image(shape = (256, 256))
|
11 |
label = gr.outputs.Label()
|
12 |
+
examples = ['apple.jpeg', 'dragon.jpeg', 'orange.jpeg', 'lemon.webp', 'green.jpeg', 'yellow.jpeg']
|
13 |
|
14 |
intf = gr.Interface(fn = classify_image, inputs=image, outputs=label, examples=examples)
|
15 |
intf.launch()
|
dragon.jpeg
ADDED
green.jpeg
ADDED
lemon.webp
ADDED
orange.jpeg
ADDED
yellow.jpeg
ADDED