2. Face Detection¶
2.1. Code¶
example:
from mpython import *
from camera import *
import time
camera = CameraV831(tx=Pin.P16, rx=Pin.P15)
camera.face_detect_init()
while True:
camera.face_detect.recognize()
if camera.face_detect.face_num != None:
print(str('Number of faces:') + str(camera.face_detect.face_num))
print(str('Confidence:') + str(camera.face_detect.max_score))
time.sleep_ms(20)
