net = dlib.cnnfacedetectionmodelv1("dlibfacerecognitionresnetmodel_v1.dat")
加载图像
人脸特征提取
dets = net(img, 1)
绘制人脸边框
for k, d in enumerate(dets): left = d.left() top = d.top() right = d.right() bottom = d.bottom() cv2.rectangle(img, (left, top), (right, bottom), (0, 255, 0), 2)
表现图像