The function returns whether the number of objects identified with the specified object class.
The example demonstrates how to detect persons on the stage with different confidence thresholds.
Code
sprite = Sprite('Tobi')
obj = ObjectDetection()
obj.enablebox()
sprite.gotoxy(-180, -110)
sprite.setsize(100)
obj.setthreshold(0.3)
obj.analysestage()
sprite.say(str(obj.detectedcount("person")) + " Person Detected at 0.3 Threshold", 2)
obj.setthreshold(0.5)
obj.analysestage()
sprite.say(str(obj.detectedcount("person")) + " Person Detected at 0.5 Threshold", 2)
obj.setthreshold(0.9)
obj.analysestage()
sprite.say(str(obj.detectedcount("person")) + " Person Detected at 0.9 Threshold", 2)
Output
Read More