ecofriendly / app.py

Commit History

Update app.py
4372096
verified

vlithish commited on

Update app.py
a707f72
verified

vlithish commited on

Update app.py
ce2f93e
verified

vlithish commited on

Update app.py
c0795c6
verified

vlithish commited on

Update app.py
e327f54
verified

vlithish commited on

Update app.py
7345cdf
verified

vlithish commited on

Update app.py
6dd53f5
verified

vlithish commited on

Update app.py
d0770f2
verified

vlithish commited on

gradio
8e684ad
verified

vlithish commited on

gradio
04d7307
verified

vlithish commited on

gradio
c33843a
verified

vlithish commited on

Create app.py
7cf723c
verified

vlithish commited on

GRADIO
b370247
verified

vlithish commited on

gradio
6f5f080
verified

vlithish commited on

import gradio as gr # Waste classification function def classify_waste(item): item = item.lower() if any(word in item for word in ["paper", "plastic", "glass", "bottle", "metal", "tin", "cardboard"]): return "♻️ Recyclable - Please place in the recycling bin." elif any(word in item for word in ["fruit", "vegetable", "food", "banana", "apple", "peel", "veg"]): return "🌱 Compostable - Add it to compost or organic waste bin." elif any(word in item for word in ["syringe", "battery", "medicine", "chemical", "paint"]): return "⚠️ Harmful/Decomposable - Dispose at hazardous waste collection." else: return "🗑️ Trash - Dispose in general waste bin." # Gradio Interface iface = gr.Interface( fn=classify_waste, inputs=gr.Textbox(label="Enter item description"), outputs=gr.Textbox(label="Classification"), title="EcoSort ♻️", description="Type the name of a waste item (e.g., 'banana peel', 'plastic bottle', 'battery') and get eco-friendly disposal advice." ) # Run app if __name__ == "__main__": iface.launch()
083d24e
verified

vlithish commited on