Table of Contents

Function Definition: isdetected(object_name = "person")

Parameters

NameTypeDescriptionExpected ValuesDefault Value
object_namestringThe class name of the object."person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic", "fire", "stop", "parking", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports", "kite", "baseball", "baseball", "skateboard", "surfboard", "tennis", "bottle", "wine", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", "carrot", "hot", "pizza", "donut", "cake", "chair", "couch", "potted", "bed", "dining", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell", "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy", "hair", or "toothbrush""person"

Description

The function returns whether the specified object is detected in the analysis or not.

Example

waste
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

Read More
All articles loaded
No more articles to load