Spaces:
Sleeping
Sleeping
Commit ·
97598d2
1
Parent(s): 0411999
Minor change
Browse files
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 &
|
| 160 |
-
"Disposal": "
|
| 161 |
-
"Tips": "
|
| 162 |
-
"Extra": "
|
| 163 |
},
|
|
|
|
| 164 |
"plastic": {
|
| 165 |
"Recycling type": "Plastic recycling",
|
| 166 |
-
"Disposal": "
|
| 167 |
-
"Tips": "
|
| 168 |
-
"Extra": "
|
| 169 |
},
|
|
|
|
| 170 |
"glass": {
|
| 171 |
"Recycling type": "Glass recycling",
|
| 172 |
-
"Disposal": "
|
| 173 |
-
"Tips": "
|
| 174 |
-
"Extra": "
|
| 175 |
},
|
|
|
|
| 176 |
"metal": {
|
| 177 |
"Recycling type": "Metal recycling",
|
| 178 |
-
"Disposal": "
|
| 179 |
-
"Tips": "Crushing cans
|
| 180 |
-
"Extra": "
|
| 181 |
},
|
|
|
|
| 182 |
"organic waste": {
|
| 183 |
-
"Recycling type": "Organic
|
| 184 |
-
"Disposal": "
|
| 185 |
-
"Tips": "
|
| 186 |
-
"Extra": "
|
| 187 |
},
|
|
|
|
| 188 |
"hazardous waste": {
|
| 189 |
"Recycling type": "Hazardous waste disposal",
|
| 190 |
-
"Disposal": "
|
| 191 |
-
"Tips": "
|
| 192 |
-
"Extra": "
|
| 193 |
},
|
|
|
|
| 194 |
"electronic waste": {
|
| 195 |
"Recycling type": "Electronic waste recycling",
|
| 196 |
-
"Disposal": "
|
| 197 |
-
"Tips": "Remove
|
| 198 |
-
"Extra": "
|
| 199 |
},
|
|
|
|
| 200 |
"textile": {
|
| 201 |
"Recycling type": "Textile recycling",
|
| 202 |
-
"Disposal": "
|
| 203 |
-
"Tips": "
|
| 204 |
-
"Extra": "
|
| 205 |
},
|
|
|
|
| 206 |
"general trash": {
|
| 207 |
-
"Recycling type": "General waste
|
| 208 |
-
"Disposal": "
|
| 209 |
-
"Tips": "
|
| 210 |
-
"Extra": "
|
| 211 |
}
|
| 212 |
}
|
| 213 |
|
| 214 |
waste_analyzation_v2 = {
|
| 215 |
"paper/cardboard": {
|
| 216 |
"Recycling type": "Paper recycling",
|
| 217 |
-
"Disposal": "
|
| 218 |
-
"Tips": "
|
| 219 |
-
"Extra": "Paper fibers
|
| 220 |
},
|
|
|
|
| 221 |
"plastic": {
|
| 222 |
"Recycling type": "Plastic recycling",
|
| 223 |
-
"Disposal": "
|
| 224 |
-
"Tips": "
|
| 225 |
-
"Extra": "
|
| 226 |
},
|
|
|
|
| 227 |
"glass": {
|
| 228 |
"Recycling type": "Glass recycling",
|
| 229 |
-
"Disposal": "
|
| 230 |
-
"Tips": "
|
| 231 |
-
"Extra": "Glass
|
| 232 |
},
|
|
|
|
| 233 |
"metal": {
|
| 234 |
"Recycling type": "Metal recycling",
|
| 235 |
-
"Disposal": "
|
| 236 |
-
"Tips": "
|
| 237 |
-
"Extra": "Metal recycling
|
| 238 |
},
|
|
|
|
| 239 |
"organic waste": {
|
| 240 |
"Recycling type": "Compostable waste",
|
| 241 |
-
"Disposal": "
|
| 242 |
-
"Tips": "Avoid adding
|
| 243 |
-
"Extra": "
|
| 244 |
},
|
|
|
|
| 245 |
"hazardous waste": {
|
| 246 |
-
"Recycling type": "Hazardous
|
| 247 |
-
"Disposal": "Dispose of batteries and
|
| 248 |
-
"Tips": "
|
| 249 |
-
"Extra": "
|
| 250 |
},
|
|
|
|
| 251 |
"electronic waste": {
|
| 252 |
"Recycling type": "E-waste recycling",
|
| 253 |
-
"Disposal": "Recycle electronics through
|
| 254 |
-
"Tips": "
|
| 255 |
-
"Extra": "Many electronics contain toxic
|
| 256 |
},
|
|
|
|
| 257 |
"textile": {
|
| 258 |
-
"Recycling type": "Clothing &
|
| 259 |
-
"Disposal": "
|
| 260 |
-
"Tips": "Repairing clothes can
|
| 261 |
-
"Extra": "Textile waste is
|
| 262 |
},
|
|
|
|
| 263 |
"general trash": {
|
| 264 |
"Recycling type": "Landfill waste",
|
| 265 |
-
"Disposal": "
|
| 266 |
-
"Tips": "
|
| 267 |
-
"Extra": "
|
| 268 |
}
|
| 269 |
}
|
| 270 |
|
| 271 |
waste_analyzation_v3 = {
|
| 272 |
"paper/cardboard": {
|
| 273 |
"Recycling type": "Paper & cardboard recycling",
|
| 274 |
-
"Disposal": "
|
| 275 |
-
"Tips": "
|
| 276 |
-
"Extra": "
|
| 277 |
},
|
|
|
|
| 278 |
"plastic": {
|
| 279 |
"Recycling type": "Plastic recycling",
|
| 280 |
-
"Disposal": "
|
| 281 |
-
"Tips": "
|
| 282 |
"Extra": "Reducing plastic use is often more effective than recycling."
|
| 283 |
},
|
|
|
|
| 284 |
"glass": {
|
| 285 |
"Recycling type": "Glass recycling",
|
| 286 |
-
"Disposal": "
|
| 287 |
-
"Tips": "
|
| 288 |
-
"Extra": "Glass
|
| 289 |
},
|
|
|
|
| 290 |
"metal": {
|
| 291 |
"Recycling type": "Metal recycling",
|
| 292 |
-
"Disposal": "
|
| 293 |
-
"Tips": "
|
| 294 |
-
"Extra": "
|
| 295 |
},
|
|
|
|
| 296 |
"organic waste": {
|
| 297 |
"Recycling type": "Organic waste composting",
|
| 298 |
-
"Disposal": "
|
| 299 |
-
"Tips": "Keep organic waste
|
| 300 |
-
"Extra": "
|
| 301 |
},
|
|
|
|
| 302 |
"hazardous waste": {
|
| 303 |
"Recycling type": "Hazardous waste safety",
|
| 304 |
-
"Disposal": "
|
| 305 |
-
"Tips": "
|
| 306 |
-
"Extra": "
|
| 307 |
},
|
|
|
|
| 308 |
"electronic waste": {
|
| 309 |
"Recycling type": "Electronic recycling",
|
| 310 |
"Disposal": "Recycle electronics instead of throwing them away.",
|
| 311 |
-
"Tips": "
|
| 312 |
-
"Extra": "E-waste recycling
|
| 313 |
},
|
|
|
|
| 314 |
"textile": {
|
| 315 |
-
"Recycling type": "Textile reuse
|
| 316 |
-
"Disposal": "
|
| 317 |
-
"Tips": "
|
| 318 |
-
"Extra": "
|
| 319 |
},
|
|
|
|
| 320 |
"general trash": {
|
| 321 |
"Recycling type": "General disposal",
|
| 322 |
-
"Disposal": "Dispose of
|
| 323 |
-
"Tips": "
|
| 324 |
-
"Extra": "
|
| 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 |
|