Spaces:
Sleeping
Sleeping
dcans
commited on
Commit
·
b8972b3
1
Parent(s):
1d8f4bf
added examples
Browse files
app.py
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
-
# AUTOGENERATED! DO NOT EDIT! File to edit: app.ipynb.
|
2 |
|
3 |
# %% auto 0
|
4 |
-
__all__ = ['learn', 'labels', 'input_image', 'output_label', 'examples', 'title', 'description', 'classify_image']
|
5 |
|
6 |
-
# %% app.ipynb 2
|
7 |
import gradio as gr
|
8 |
from fastai.vision.all import *
|
9 |
|
10 |
-
# %% app.ipynb 4
|
11 |
learn = load_learner("model.pkl")
|
12 |
|
13 |
-
# %% app.ipynb
|
14 |
labels = learn.dls.vocab
|
15 |
def classify_image(img):
|
16 |
img = PILImage.create(img)
|
@@ -19,13 +19,13 @@ def classify_image(img):
|
|
19 |
|
20 |
|
21 |
|
22 |
-
# %% app.ipynb
|
23 |
input_image = gr.Image()
|
24 |
output_label = gr.Label()
|
25 |
-
examples = ["futbol.jpeg", "basketbol.jpeg"]
|
26 |
title = "Sports Ball Classifier"
|
27 |
description = "A ball classifier Deep learning model demo"
|
28 |
|
29 |
-
# %% app.ipynb
|
30 |
-
demo = gr.Interface(fn=classify_image, inputs=input_image, outputs=output_label, description=description, title=title)
|
31 |
demo.launch(inline=False)
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
|
2 |
|
3 |
# %% auto 0
|
4 |
+
__all__ = ['learn', 'labels', 'input_image', 'output_label', 'examples', 'title', 'description', 'demo', 'classify_image']
|
5 |
|
6 |
+
# %% ../app.ipynb 2
|
7 |
import gradio as gr
|
8 |
from fastai.vision.all import *
|
9 |
|
10 |
+
# %% ../app.ipynb 4
|
11 |
learn = load_learner("model.pkl")
|
12 |
|
13 |
+
# %% ../app.ipynb 10
|
14 |
labels = learn.dls.vocab
|
15 |
def classify_image(img):
|
16 |
img = PILImage.create(img)
|
|
|
19 |
|
20 |
|
21 |
|
22 |
+
# %% ../app.ipynb 11
|
23 |
input_image = gr.Image()
|
24 |
output_label = gr.Label()
|
25 |
+
examples = ["beachball.jpg","futbol.jpeg", "basketbol.jpeg", "golf-ball.jpg", "tennisball.jpeg"]
|
26 |
title = "Sports Ball Classifier"
|
27 |
description = "A ball classifier Deep learning model demo"
|
28 |
|
29 |
+
# %% ../app.ipynb 12
|
30 |
+
demo = gr.Interface(fn=classify_image, inputs=input_image, outputs=output_label, description=description, title=title, examples=examples)
|
31 |
demo.launch(inline=False)
|