Table of Contents

Waste Classifier – Python

waste
Example Description
A waste management system that will differentiate the waste based on its type in Python Coding Environment. If it detects biodegradable waste, the LEDs Quarky’s matrix will turn green. If it’s non-biodegradable waste, the LEDs will turn blue.

Code

sprite = Sprite('Tobi')
od = ObjectDetection()
speech = TexttoSpeech()
quarky = Quarky()

od.video("on", 1)
od.enablebox()
od.setthreshold(0.5)

speech.setvoice('alto')
speech.setlanguage('en')

while True:
  od.analysecamera()
  
  if od.isdetected('banana'):
    quarky.drawpattern("ccccccccccccccccccccccccccccccccccc")
    speech.speak("Biodegradable Waste")
  
  if od.isdetected('bottle'):
    quarky.drawpattern("fffffffffffffffffffffffffffffffffff")
    speech.speak("Non Biodegradable Waste")

Output

waste