2. 人脸检测¶
2.1. 代码¶
例程:
from mpython import *
import smartcamera_new as smartcamera
import time
smart_camera = smartcamera.SmartCamera(tx=Pin.P16, rx=Pin.P15)
smart_camera.face_detect_init(1)
while True:
smart_camera.face_detect.recognize()
if smart_camera.face_detect.face_num != None:
print(str('人脸数量:') + str(smart_camera.face_detect.face_num))
print(str('置信度:') + str(smart_camera.face_detect.max_score))
time.sleep_ms(20)
