haxerwddle commited on
Commit
97598d2
·
1 Parent(s): 0411999

Minor change

Browse files
Files changed (1) hide show
  1. app.py +109 -85
app.py CHANGED
@@ -156,172 +156,196 @@ def explain_recycling(class_label):
156
  # ------------------ PIPELINE ------------------
157
  waste_analyzation_v1 = {
158
  "paper/cardboard": {
159
- "Recycling type": "Paper & Cardboard recycling",
160
- "Disposal": "Flatten boxes and stack paper neatly before placing them in the paper recycling bin.",
161
- "Tips": "If it’s wet, greasy, or food-stained, it’s better off in the trash or compost.",
162
- "Extra": "Removing tape and plastic windows helps recycling facilities work more efficiently."
163
  },
 
164
  "plastic": {
165
  "Recycling type": "Plastic recycling",
166
- "Disposal": "Rinse plastic containers, let them dry, and place them in the plastic recycling bin.",
167
- "Tips": "When in doubt, check the recycling number stamped on the item.",
168
- "Extra": "Soft plastics like bags often need to be returned to collection points, not curbside bins."
169
  },
 
170
  "glass": {
171
  "Recycling type": "Glass recycling",
172
- "Disposal": "Rinse glass bottles or jars and place them gently into the glass container.",
173
- "Tips": "Remove lids and caps, as they are usually recycled separately.",
174
- "Extra": "Broken glass can be dangerous and may not be accepted in all programs."
175
  },
 
176
  "metal": {
177
  "Recycling type": "Metal recycling",
178
- "Disposal": "Empty and rinse metal cans before placing them in the metal recycling bin.",
179
- "Tips": "Crushing cans saves space and reduces transport emissions.",
180
- "Extra": "Never recycle pressurized or hazardous metal containers."
181
  },
 
182
  "organic waste": {
183
- "Recycling type": "Organic / compost waste",
184
- "Disposal": "Place food scraps and plant waste into a compost or organic waste bin.",
185
- "Tips": "Cut large scraps into smaller pieces so they break down faster.",
186
- "Extra": "Composting organic waste keeps valuable nutrients out of landfills."
187
  },
 
188
  "hazardous waste": {
189
  "Recycling type": "Hazardous waste disposal",
190
- "Disposal": "Take batteries and hazardous materials to official collection points.",
191
- "Tips": "Store batteries in a dry container until you can dispose of them safely.",
192
- "Extra": "Improper battery disposal is a common cause of recycling facility fires."
193
  },
 
194
  "electronic waste": {
195
  "Recycling type": "Electronic waste recycling",
196
- "Disposal": "Bring electronics to certified e-waste recycling centers.",
197
- "Tips": "Remove batteries and personal data before disposal if possible.",
198
- "Extra": "Electronics contain valuable metals that can be recovered and reused."
199
  },
 
200
  "textile": {
201
  "Recycling type": "Textile recycling",
202
- "Disposal": "Donate wearable clothing or place textiles in dedicated textile bins.",
203
- "Tips": "Clean clothes before donating to improve reuse chances.",
204
- "Extra": "Even damaged textiles can be recycled into industrial materials."
205
  },
 
206
  "general trash": {
207
- "Recycling type": "General waste / landfill",
208
- "Disposal": "Dispose of non-recyclable items in the regular trash bin.",
209
- "Tips": "Try to separate recyclables carefully before throwing items away.",
210
- "Extra": "Reducing trash helps lower landfill and incineration impact."
211
  }
212
  }
213
 
214
  waste_analyzation_v2 = {
215
  "paper/cardboard": {
216
  "Recycling type": "Paper recycling",
217
- "Disposal": "Place clean, dry paper and cardboard into the paper recycling container.",
218
- "Tips": "Grease stains can ruin an entire batch of recycled paper.",
219
- "Extra": "Paper fibers can only be recycled a limited number of times."
220
  },
 
221
  "plastic": {
222
  "Recycling type": "Plastic recycling",
223
- "Disposal": "Recycle plastic packaging that is accepted by your local program.",
224
- "Tips": "Empty containers completely to avoid contamination.",
225
- "Extra": "Not all plastics are recyclable, even if they look similar."
226
  },
 
227
  "glass": {
228
  "Recycling type": "Glass recycling",
229
- "Disposal": "Recycle glass bottles and jars after a quick rinse.",
230
- "Tips": "Keep ceramics and drinking glasses out of glass recycling bins.",
231
- "Extra": "Glass can be recycled repeatedly without losing quality."
232
  },
 
233
  "metal": {
234
  "Recycling type": "Metal recycling",
235
- "Disposal": "Recycle aluminum and steel cans once they are clean.",
236
- "Tips": "Leaving food residue can attract pests during storage.",
237
- "Extra": "Metal recycling saves a significant amount of energy."
238
  },
 
239
  "organic waste": {
240
  "Recycling type": "Compostable waste",
241
- "Disposal": "Put biodegradable food and garden waste into compost bins.",
242
- "Tips": "Avoid adding liquids or oils unless your compost system allows it.",
243
- "Extra": "Proper composting reduces methane emissions."
244
  },
 
245
  "hazardous waste": {
246
- "Recycling type": "Hazardous materials handling",
247
- "Disposal": "Dispose of batteries and chemicals through authorized programs.",
248
- "Tips": "Tape battery terminals to reduce fire risk during transport.",
249
- "Extra": "Hazardous waste should never be mixed with household trash."
250
  },
 
251
  "electronic waste": {
252
  "Recycling type": "E-waste recycling",
253
- "Disposal": "Recycle electronics through approved e-waste services.",
254
- "Tips": "Check for manufacturer take-back programs.",
255
- "Extra": "Many electronics contain toxic substances if mishandled."
256
  },
 
257
  "textile": {
258
- "Recycling type": "Clothing & textile reuse",
259
- "Disposal": "Reuse, donate, or recycle unwanted clothing responsibly.",
260
- "Tips": "Repairing clothes can extend their life significantly.",
261
- "Extra": "Textile waste is one of the fastest-growing waste streams."
262
  },
 
263
  "general trash": {
264
  "Recycling type": "Landfill waste",
265
- "Disposal": "Throw away items that cannot be reused or recycled.",
266
- "Tips": "Reducing consumption is the best way to cut trash.",
267
- "Extra": "Landfills should be a last resort whenever possible."
268
  }
269
  }
270
 
271
  waste_analyzation_v3 = {
272
  "paper/cardboard": {
273
  "Recycling type": "Paper & cardboard recycling",
274
- "Disposal": "Recycle paper-based items that are clean and dry.",
275
- "Tips": "If you’re unsure, it’s safer to trash contaminated paper.",
276
- "Extra": "Keeping recyclables clean improves overall recycling success."
277
  },
 
278
  "plastic": {
279
  "Recycling type": "Plastic recycling",
280
- "Disposal": "Recycle plastics according to local guidelines.",
281
- "Tips": "A quick rinse is enough—no need to scrub perfectly.",
282
  "Extra": "Reducing plastic use is often more effective than recycling."
283
  },
 
284
  "glass": {
285
  "Recycling type": "Glass recycling",
286
- "Disposal": "Recycle glass containers carefully to avoid breakage.",
287
- "Tips": "Small broken pieces may be rejected by sorting machines.",
288
- "Extra": "Glass recycling helps reduce raw material extraction."
289
  },
 
290
  "metal": {
291
  "Recycling type": "Metal recycling",
292
- "Disposal": "Recycle metal items that are empty and clean.",
293
- "Tips": "Sharp edges should be handled with care.",
294
- "Extra": "Recycling metal uses far less energy than producing new metal."
295
  },
 
296
  "organic waste": {
297
  "Recycling type": "Organic waste composting",
298
- "Disposal": "Compost food scraps and plant waste where available.",
299
- "Tips": "Keep organic waste separate to avoid odors and pests.",
300
- "Extra": "Compost can be used to enrich soil naturally."
301
  },
 
302
  "hazardous waste": {
303
  "Recycling type": "Hazardous waste safety",
304
- "Disposal": "Dispose of hazardous items only at proper facilities.",
305
- "Tips": "Keep hazardous waste away from heat and moisture.",
306
- "Extra": "Correct disposal protects both people and the environment."
307
  },
 
308
  "electronic waste": {
309
  "Recycling type": "Electronic recycling",
310
  "Disposal": "Recycle electronics instead of throwing them away.",
311
- "Tips": "Many cities offer free e-waste collection events.",
312
- "Extra": "E-waste recycling prevents toxic pollution."
313
  },
 
314
  "textile": {
315
- "Recycling type": "Textile reuse & recycling",
316
- "Disposal": "Choose reuse or recycling over disposal whenever possible.",
317
- "Tips": "Even worn textiles can have a second life.",
318
- "Extra": "Textile recycling reduces demand for new raw materials."
319
  },
 
320
  "general trash": {
321
  "Recycling type": "General disposal",
322
- "Disposal": "Dispose of remaining waste responsibly.",
323
- "Tips": "Double-check recyclables before tossing items away.",
324
- "Extra": "Small actions add up to meaningful waste reduction."
325
  }
326
  }
327
 
 
156
  # ------------------ PIPELINE ------------------
157
  waste_analyzation_v1 = {
158
  "paper/cardboard": {
159
+ "Recycling type": "Paper & cardboard recycling",
160
+ "Disposal": "Reuse clean paper for notes, wrapping, or simple DIY crafts; flatten remaining cardboard and recycle it.",
161
+ "Tips": "Wet or food-stained paper should be composted or thrown away.",
162
+ "Extra": "Loose paper should be stacked to prevent it from blowing away during collection."
163
  },
164
+
165
  "plastic": {
166
  "Recycling type": "Plastic recycling",
167
+ "Disposal": "Reuse sturdy plastic containers for storage or organization; rinse and recycle those you no longer need.",
168
+ "Tips": "Do not recycle soft plastics unless your area has a dedicated drop-off.",
169
+ "Extra": "Residue left inside containers can contaminate other recyclables."
170
  },
171
+
172
  "glass": {
173
  "Recycling type": "Glass recycling",
174
+ "Disposal": "Reuse jars for food storage, plants, or small items; recycle cracked or unused glass containers.",
175
+ "Tips": "Wrap broken glass separately if your program does not accept it.",
176
+ "Extra": "Glass recycling reduces the need for sand mining."
177
  },
178
+
179
  "metal": {
180
  "Recycling type": "Metal recycling",
181
+ "Disposal": "Reuse metal tins for storage or tools; rinse and recycle cans that are no longer useful.",
182
+ "Tips": "Crushing cans is usually allowed, but check local rules first.",
183
+ "Extra": "Metal can be recycled repeatedly without losing strength."
184
  },
185
+
186
  "organic waste": {
187
+ "Recycling type": "Organic waste composting",
188
+ "Disposal": "Turn food scraps into compost for plants or soil; otherwise place them in an organic waste bin.",
189
+ "Tips": "Drain excess liquids to reduce odor and pests.",
190
+ "Extra": "Compost improves soil structure and water retention."
191
  },
192
+
193
  "hazardous waste": {
194
  "Recycling type": "Hazardous waste disposal",
195
+ "Disposal": "Bring batteries and chemicals to designated hazardous waste collection sites.",
196
+ "Tips": "Never place batteries loose in household trash.",
197
+ "Extra": "Battery fires are a leading cause of recycling facility damage."
198
  },
199
+
200
  "electronic waste": {
201
  "Recycling type": "Electronic waste recycling",
202
+ "Disposal": "Take electronics to certified e-waste recycling centers.",
203
+ "Tips": "Remove SIM cards, memory cards, and batteries before recycling.",
204
+ "Extra": "E-waste contains materials that are harmful if landfilled."
205
  },
206
+
207
  "textile": {
208
  "Recycling type": "Textile recycling",
209
+ "Disposal": "Reuse old clothes as cleaning rags or donate wearable items; recycle damaged textiles if possible.",
210
+ "Tips": "Bag textiles to keep them dry and reusable.",
211
+ "Extra": "Textiles should never be placed in regular recycling bins."
212
  },
213
+
214
  "general trash": {
215
+ "Recycling type": "General waste",
216
+ "Disposal": "Throw non-recyclable or contaminated items into the general trash bin.",
217
+ "Tips": "Check for mixed materials before assuming an item is recyclable.",
218
+ "Extra": "Trash contamination is a major reason recyclables are rejected."
219
  }
220
  }
221
 
222
  waste_analyzation_v2 = {
223
  "paper/cardboard": {
224
  "Recycling type": "Paper recycling",
225
+ "Disposal": "Reuse clean paper for crafts, packaging, or notes; recycle what you cannot reuse.",
226
+ "Tips": "Remove food residue, plastic coatings, or heavy grease.",
227
+ "Extra": "Paper fibers weaken each time they are recycled."
228
  },
229
+
230
  "plastic": {
231
  "Recycling type": "Plastic recycling",
232
+ "Disposal": "Repurpose containers for storage or household use, then recycle accepted plastics.",
233
+ "Tips": "Check the recycling number if unsure whether a plastic is accepted.",
234
+ "Extra": "Most recycling programs only accept rigid plastics."
235
  },
236
+
237
  "glass": {
238
  "Recycling type": "Glass recycling",
239
+ "Disposal": "Reuse jars for food, tools, or décor; recycle bottles and jars when no longer needed.",
240
+ "Tips": "Do not mix ceramics or heat-resistant glass with bottles.",
241
+ "Extra": "Glass recycling saves energy and raw materials."
242
  },
243
+
244
  "metal": {
245
  "Recycling type": "Metal recycling",
246
+ "Disposal": "Reuse metal containers where possible; recycle clean aluminum and steel cans.",
247
+ "Tips": "Sharp metal edges should be handled carefully.",
248
+ "Extra": "Metal recycling requires far less energy than mining."
249
  },
250
+
251
  "organic waste": {
252
  "Recycling type": "Compostable waste",
253
+ "Disposal": "Compost food and garden waste to produce natural fertilizer.",
254
+ "Tips": "Avoid adding bones or cooked food unless allowed.",
255
+ "Extra": "Composting reduces methane from landfills."
256
  },
257
+
258
  "hazardous waste": {
259
+ "Recycling type": "Hazardous material handling",
260
+ "Disposal": "Dispose of chemicals, batteries, and paints at approved collection facilities.",
261
+ "Tips": "Keep hazardous waste in original containers if possible.",
262
+ "Extra": "Improper disposal can contaminate soil and water."
263
  },
264
+
265
  "electronic waste": {
266
  "Recycling type": "E-waste recycling",
267
+ "Disposal": "Recycle electronics through official e-waste programs or retailers.",
268
+ "Tips": "Back up and erase data before disposal.",
269
+ "Extra": "Many electronics contain toxic metals."
270
  },
271
+
272
  "textile": {
273
+ "Recycling type": "Clothing reuse & recycling",
274
+ "Disposal": "Turn old textiles into rags or donate wearable clothes before recycling.",
275
+ "Tips": "Repairing clothes can delay disposal.",
276
+ "Extra": "Textile waste is growing rapidly worldwide."
277
  },
278
+
279
  "general trash": {
280
  "Recycling type": "Landfill waste",
281
+ "Disposal": "Dispose of items that cannot be recycled or composted.",
282
+ "Tips": "When in doubt, trash is better than contaminating recycling.",
283
+ "Extra": "One wrong item can ruin an entire recycling load."
284
  }
285
  }
286
 
287
  waste_analyzation_v3 = {
288
  "paper/cardboard": {
289
  "Recycling type": "Paper & cardboard recycling",
290
+ "Disposal": "Reuse clean paper for simple DIY or notes, then recycle the rest.",
291
+ "Tips": "Trash paper that is soaked or heavily stained.",
292
+ "Extra": "Clean paper improves recycling efficiency."
293
  },
294
+
295
  "plastic": {
296
  "Recycling type": "Plastic recycling",
297
+ "Disposal": "Reuse containers for storage and recycle accepted plastics afterward.",
298
+ "Tips": "Caps should usually stay on bottles.",
299
  "Extra": "Reducing plastic use is often more effective than recycling."
300
  },
301
+
302
  "glass": {
303
  "Recycling type": "Glass recycling",
304
+ "Disposal": "Reuse glass jars when possible, recycle broken or unused containers.",
305
+ "Tips": "Broken glass may be rejected by sorting machines.",
306
+ "Extra": "Glass can be recycled endlessly."
307
  },
308
+
309
  "metal": {
310
  "Recycling type": "Metal recycling",
311
+ "Disposal": "Reuse metal tins or recycle clean metal items.",
312
+ "Tips": "Ensure containers are empty before recycling.",
313
+ "Extra": "Recycled metal saves energy and resources."
314
  },
315
+
316
  "organic waste": {
317
  "Recycling type": "Organic waste composting",
318
+ "Disposal": "Convert organic waste into compost for plants or gardens.",
319
+ "Tips": "Keep organic waste sealed to avoid pests.",
320
+ "Extra": "Finished compost can enrich garden soil."
321
  },
322
+
323
  "hazardous waste": {
324
  "Recycling type": "Hazardous waste safety",
325
+ "Disposal": "Take hazardous items to proper disposal facilities.",
326
+ "Tips": "Never mix hazardous waste with recyclables.",
327
+ "Extra": "Safe disposal prevents fires and pollution."
328
  },
329
+
330
  "electronic waste": {
331
  "Recycling type": "Electronic recycling",
332
  "Disposal": "Recycle electronics instead of throwing them away.",
333
+ "Tips": "Check for local e-waste events.",
334
+ "Extra": "E-waste recycling reduces toxic exposure."
335
  },
336
+
337
  "textile": {
338
+ "Recycling type": "Textile reuse",
339
+ "Disposal": "Reuse textiles as rags or donate them before recycling.",
340
+ "Tips": "Keep textiles clean and dry.",
341
+ "Extra": "Textiles can be reused even when worn."
342
  },
343
+
344
  "general trash": {
345
  "Recycling type": "General disposal",
346
+ "Disposal": "Dispose of non-recyclable waste in trash bins.",
347
+ "Tips": "Sort recyclables before throwing items away.",
348
+ "Extra": "Proper sorting improves recycling success."
349
  }
350
  }
351