12. 20 categories of object recognition¶
12.1. Code¶
example:
from mpython import *
from camera import *
import time
camera = CameraV831(tx=Pin.P16, rx=Pin.P15)
camera.yolo_detect_init()
while True:
camera.yolo_detect.recognize()
if camera.yolo_detect.id != None:
print(str('category:') + str(camera.yolo_detect.category_list[camera.yolo_detect.id]))
print(str('Confidence:') + str(camera.yolo_detect.max_score))
time.sleep_ms(20)
