pushpinder06 commited on
Commit
bc82045
·
verified ·
1 Parent(s): c296fe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- interface = gr.Interface(
25
  fn=predict_from_webcam,
26
- inputs=gr.Camera(type="pil"),
27
  outputs="text",
 
28
  title="Live Waste Classifier",
29
- description="Point your webcam at a waste item. The model will predict its type in real-time."
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()