Spaces:
Runtime error
Runtime error
Commit
·
a9eaf12
1
Parent(s):
f41c7c3
update links and interface
Browse files
app.py
CHANGED
|
@@ -7,11 +7,13 @@ title = "Open/Closed Door Classifier"
|
|
| 7 |
description = "A classifier trained using fastai on search images of open and closed doors." \
|
| 8 |
"Created for Lesson 2 in the fastai course."
|
| 9 |
|
| 10 |
-
examples = ['open-door.jpeg',
|
| 11 |
-
'crack_2.jpg', 'red_arch.jpg',
|
| 12 |
-
'green.jpg', 'red.jpg', 'opening_door.jpg',
|
| 13 |
-
'inside.jpg', 'cracked_3.jpg', 'old.jpg',
|
| 14 |
-
'blue.jpg', 'closed-door.jpeg', 'crack_1.jpg']
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
learn = load_learner('door_model.pkl')
|
|
@@ -26,11 +28,10 @@ def predict(img):
|
|
| 26 |
|
| 27 |
iface = gr.Interface(
|
| 28 |
fn=predict,
|
| 29 |
-
inputs=gr.
|
| 30 |
-
outputs=gr.
|
| 31 |
title=title,
|
| 32 |
description=description,
|
| 33 |
examples=examples,
|
| 34 |
-
interpretation="default"
|
| 35 |
-
enable_queue=True).launch()
|
| 36 |
|
|
|
|
| 7 |
description = "A classifier trained using fastai on search images of open and closed doors." \
|
| 8 |
"Created for Lesson 2 in the fastai course."
|
| 9 |
|
| 10 |
+
examples = ['./open-door.jpeg',
|
| 11 |
+
'./crack_2.jpg', './red_arch.jpg',
|
| 12 |
+
'./green.jpg', './red.jpg', './opening_door.jpg',
|
| 13 |
+
'./inside.jpg', './cracked_3.jpg', './old.jpg',
|
| 14 |
+
'./blue.jpg', './closed-door.jpeg', './crack_1.jpg']
|
| 15 |
+
|
| 16 |
+
|
| 17 |
|
| 18 |
|
| 19 |
learn = load_learner('door_model.pkl')
|
|
|
|
| 28 |
|
| 29 |
iface = gr.Interface(
|
| 30 |
fn=predict,
|
| 31 |
+
inputs=gr.Image(shape=(512, 512)),
|
| 32 |
+
outputs=gr.Label(num_top_classes=3),
|
| 33 |
title=title,
|
| 34 |
description=description,
|
| 35 |
examples=examples,
|
| 36 |
+
interpretation="default").queue().launch()
|
|
|
|
| 37 |
|