上代码: #coding=utf-8 import cv2 import dlib path = "imagePath/9.jpg" img = cv2.imread(path) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #人脸分类器 detector = dlib.get_frontal_face_detector() # 获取人脸检测器 predictor = dlib.shape_predictor( "shape_predictor_68_face_landmarks.dat" ) color = (0, 255, 0) # 定义绘