MeghanaM4 commited on
Commit
dfc9a57
·
verified ·
1 Parent(s): 1b92c84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -1
app.py CHANGED
@@ -19,5 +19,30 @@ def classify_image(img):
19
  image = "image"
20
  label = "label"
21
 
22
- intf = gr.Interface(fn=classify_image, inputs = image, outputs = label)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  intf.launch(inline = False, share = True)
 
19
  image = "image"
20
  label = "label"
21
 
22
+ modelIntf = gr.Interface(fn=classify_image, inputs = image, outputs = label)
23
+
24
+ def info(type):
25
+ if (type == 'Primary'):
26
+ return "Your recyclable type is Primary, which makes up the most recyclable materials. You're in luck, your material can just be put in your curbside blue bin, or wherever you usually recycle."
27
+ elif (type == 'Tertiary'):
28
+ return "Tertiary items are the least recyclable materials. These types of recycled material are used as feedstock (raw material to supply or fuel a machine or industrial process) in a process to make new chemicals and fuels. Heavy/industrial paper items should be disposed at a recycling center."
29
+ elif (type == 'Metals'):
30
+ return "Metals should be transported to your local scrapyard, which, according to your location is at New World Recycling, 1079 E 5th Ave, Columbus, OH."
31
+ elif (type == 'Organic Matter'):
32
+ return "Organic Matter! You're in luck, all you have to do to dispose of this is put it outside. Composting is a great way to safely get rid of food products and greatly improves your plants' soil health and enriches its diversity."
33
+ elif (type == 'Batteries'):
34
+ return "Batters can be disposed of in a myriad of ways. Standard AA or AAA dead batteries can be thrown in the trash, but lithium-ion or computer batteries take special care. Visit your local battery disposal center and ensure that your batteries aren't leaking harmful acids."
35
+ else:
36
+ return "Sorry, we don't recognize that type of recyclable. Go to the Waste Detective page and see what type your trash is!"
37
+
38
+ with gr.Blocks() as infoBlock:
39
+ gr.Markdown("Welcome to the Waste Detective Information Center!")
40
+ with gr.Row():
41
+ inp = gr.Textbox(placeholder = "What recyclable type did you get?")
42
+ out = gr.Textbox()
43
+ btn = gr.Button("How do I recyle this?")
44
+ btn.click(fn = info, inputs = inp, outputs = out)
45
+
46
+ intf = gr.TabbedInterface([modelIntf, infoBlock], ["Waste Detective", "Info Center"], "Waste Detective", "ocean")
47
+
48
  intf.launch(inline = False, share = True)