vlithish commited on
Commit
04d7307
·
verified ·
1 Parent(s): c33843a

![stock-vector-bin-recycle-plastic-green-wheelie-bin-for-waste-isolated-on-white-background-green-bin-with-1306559440.jpg](https://cdn-uploads.huggingface.co/production/uploads/68b405a63f4b0bb6352f49d3/AagOoCbehsAdi_IM22fUu.jpeg)

![blue-recycling-bin-with-recycle-symbol-for-waste-management-and-sustainability-png.png](https://cdn-uploads.huggingface.co/production/uploads/68b405a63f4b0bb6352f49d3/Ii5c91a3qlpyCjVhDbQsO.png)

![medical-waste-bin.jpeg](https://cdn-uploads.huggingface.co/production/uploads/68b405a63f4b0bb6352f49d3/k5Ij2mYnRPHssedJtStYc.jpeg)

![Bin-Plastic-45L-with-pedal-Grey-colour.jpg](https://cdn-uploads.huggingface.co/production/uploads/68b405a63f4b0bb6352f49d3/gv8txVF4Zubg3Ou0FviWu.jpeg)

Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,11 +1,11 @@
1
  import gradio as gr
2
 
3
- # Define categories
4
  compostable = ["vegetable", "fruit", "food", "leaves"]
5
  recyclable = ["plastic", "paper", "glass", "metal", "bottle", "can"]
6
  harmful = ["syringe", "battery", "medical", "chemical"]
7
 
8
- # Map bin images to your uploaded filenames
9
  bin_images = {
10
  "Compostable": "stock-vector-bin-recycle-plastic-green-wheelie-bin-for-waste-isolated-on-white-background-green-bin-with-1306559440.jpg",
11
  "Recyclable": "blue-recycling-bin-with-recycle-symbol-for-waste-management-and-sustainability-png.png",
@@ -21,7 +21,8 @@ def classify_waste(item):
21
  elif item in harmful:
22
  return "⚠️ Harmful/Non-Decomposable Waste", bin_images["Harmful"]
23
  else:
24
- return "🚮 General Waste", None # Optional: add a grey bin if you want
 
25
 
26
  # Gradio UI
27
  iface = gr.Interface(
@@ -34,3 +35,4 @@ iface = gr.Interface(
34
 
35
  if __name__ == "__main__":
36
  iface.launch()
 
 
1
  import gradio as gr
2
 
3
+ # Categories
4
  compostable = ["vegetable", "fruit", "food", "leaves"]
5
  recyclable = ["plastic", "paper", "glass", "metal", "bottle", "can"]
6
  harmful = ["syringe", "battery", "medical", "chemical"]
7
 
8
+ # Bin images
9
  bin_images = {
10
  "Compostable": "stock-vector-bin-recycle-plastic-green-wheelie-bin-for-waste-isolated-on-white-background-green-bin-with-1306559440.jpg",
11
  "Recyclable": "blue-recycling-bin-with-recycle-symbol-for-waste-management-and-sustainability-png.png",
 
21
  elif item in harmful:
22
  return "⚠️ Harmful/Non-Decomposable Waste", bin_images["Harmful"]
23
  else:
24
+ # Anything unknown defaults to Compostable
25
+ return "✅ Compostable Waste", bin_images["Compostable"]
26
 
27
  # Gradio UI
28
  iface = gr.Interface(
 
35
 
36
  if __name__ == "__main__":
37
  iface.launch()
38
+