Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,12 +21,14 @@ def predict_from_webcam(image):
|
|
| 21 |
return f"{predicted_class} ({confidence*100:.1f}%)"
|
| 22 |
|
| 23 |
# Use gr.Camera instead of gr.Image
|
| 24 |
-
|
| 25 |
fn=predict_from_webcam,
|
| 26 |
-
inputs=gr.
|
| 27 |
outputs="text",
|
|
|
|
| 28 |
title="Live Waste Classifier",
|
| 29 |
-
description="
|
| 30 |
)
|
| 31 |
|
|
|
|
| 32 |
interface.launch()
|
|
|
|
| 21 |
return f"{predicted_class} ({confidence*100:.1f}%)"
|
| 22 |
|
| 23 |
# Use gr.Camera instead of gr.Image
|
| 24 |
+
gr.Interface(
|
| 25 |
fn=predict_from_webcam,
|
| 26 |
+
inputs=gr.Image(shape=(224, 224), tool=None, type="pil", label="Capture Image from Webcam"),
|
| 27 |
outputs="text",
|
| 28 |
+
live=True,
|
| 29 |
title="Live Waste Classifier",
|
| 30 |
+
description="Click webcam icon and show a waste image to classify."
|
| 31 |
)
|
| 32 |
|
| 33 |
+
|
| 34 |
interface.launch()
|