Spaces:
Runtime error
Runtime error
amit-asl commited on
Commit ·
e193530
1
Parent(s): ea8f675
changes
Browse files- app/main.py +3 -11
app/main.py
CHANGED
|
@@ -9,24 +9,16 @@ def predict_image(image):
|
|
| 9 |
return pred[0]
|
| 10 |
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
image_input = gr.Image(type="pil")
|
| 15 |
-
|
| 16 |
output = gr.Text()
|
| 17 |
|
| 18 |
-
|
| 19 |
fn=predict_image,
|
| 20 |
inputs=image_input,
|
| 21 |
outputs=output,
|
| 22 |
-
capture_session=True,
|
| 23 |
title="Cat or Dog Classifier",
|
| 24 |
description="Upload an image to classify whether it's a cat or a dog."
|
| 25 |
-
)
|
| 26 |
-
return iface
|
| 27 |
-
|
| 28 |
-
if __name__ == "__main__":
|
| 29 |
-
iface = create_interface()
|
| 30 |
-
iface.launch()
|
| 31 |
|
| 32 |
|
|
|
|
| 9 |
return pred[0]
|
| 10 |
|
| 11 |
|
| 12 |
+
if __name__ == "__main__":
|
|
|
|
| 13 |
image_input = gr.Image(type="pil")
|
|
|
|
| 14 |
output = gr.Text()
|
| 15 |
|
| 16 |
+
gr.Interface(
|
| 17 |
fn=predict_image,
|
| 18 |
inputs=image_input,
|
| 19 |
outputs=output,
|
|
|
|
| 20 |
title="Cat or Dog Classifier",
|
| 21 |
description="Upload an image to classify whether it's a cat or a dog."
|
| 22 |
+
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
|