Spaces:
Runtime error
Runtime error
Commit
·
5d0802c
1
Parent(s):
78f684b
images update
Browse files
app.py
CHANGED
|
@@ -7,11 +7,11 @@ 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 = [
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
|
| 16 |
examples = list(map(lambda x: "examples/" + x, examples))
|
| 17 |
#print(examples)
|
|
@@ -22,7 +22,7 @@ labels = learn.dls.vocab
|
|
| 22 |
|
| 23 |
def predict(img_input):
|
| 24 |
img = PILImage.create(img_input)
|
| 25 |
-
pred,pred_idx,probs = learn.predict(
|
| 26 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 27 |
|
| 28 |
|
|
|
|
| 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.jpg",
|
| 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"]
|
| 15 |
|
| 16 |
examples = list(map(lambda x: "examples/" + x, examples))
|
| 17 |
#print(examples)
|
|
|
|
| 22 |
|
| 23 |
def predict(img_input):
|
| 24 |
img = PILImage.create(img_input)
|
| 25 |
+
pred,pred_idx,probs = learn.predict(img_input)
|
| 26 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 27 |
|
| 28 |
|