Spaces:
Runtime error
Runtime error
Commit
·
19f236b
1
Parent(s):
e39d03a
reverting to deprecated code to see if image examples work
Browse files
app.py
CHANGED
|
@@ -31,17 +31,17 @@ learn = load_learner('door_model.pkl')
|
|
| 31 |
labels = learn.dls.vocab
|
| 32 |
|
| 33 |
def predict(img):
|
| 34 |
-
img = PILImage.create(img)
|
| 35 |
pred,pred_idx,probs = learn.predict(img)
|
| 36 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 37 |
|
| 38 |
|
| 39 |
iface = gr.Interface(
|
| 40 |
fn=predict,
|
| 41 |
-
inputs=gr.Image(shape=(512, 512)),
|
| 42 |
-
outputs=gr.Label(
|
| 43 |
title=title,
|
| 44 |
description=description,
|
| 45 |
-
examples=['examples/red.jpg']).
|
| 46 |
|
| 47 |
|
|
|
|
| 31 |
labels = learn.dls.vocab
|
| 32 |
|
| 33 |
def predict(img):
|
| 34 |
+
#img = PILImage.create(img)
|
| 35 |
pred,pred_idx,probs = learn.predict(img)
|
| 36 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 37 |
|
| 38 |
|
| 39 |
iface = gr.Interface(
|
| 40 |
fn=predict,
|
| 41 |
+
inputs=gr.inputs.Image(shape=(512, 512)),
|
| 42 |
+
outputs=gr.outputs.Label(),
|
| 43 |
title=title,
|
| 44 |
description=description,
|
| 45 |
+
examples=['examples/red.jpg']).launch()
|
| 46 |
|
| 47 |
|