("landmarks_cnn.onnx")
2image = cv.imread("D:/facedb/test/464.jpg")
3cv.imshow("input", image)
4h,...w, c = image.shape
5blob = cv.dnn.blobFromImage(image, 0.00392, (64, 64), (0.5, 0.5, 0.5), False) /...(image, (np.int32(x1), np.int32(y1)), 2, (0, 0, 255), 2, 8, 0)
15cv.imshow("人脸五点检测", image)
16cv.imwrite...("D:/landmark_det_result.png", image)
17cv.waitKey(0)
18cv.destroyAllWindows()
运行结果如下:
?...执行推理与输出解析,得到表情分类的结果,代码如下:
1Rect box(x1, y1, x2 - x1, y2 - y1);
2Mat roi = frame(box);
3Mat face_blob