python dlib 人脸检测
1. anaconda 安装dlib库: 安装命令: https://anaconda.org/conda-forge/dlib 打开Anaconda Prompt:输入 conda install -c conda-forge dlib=19.9 等待安装完成即可; 2. 测试示例 方法1:基于Hog-SVM人脸检测器 方法2:基于深度卷积神经网络实现的人脸检测 # -*- coding: utf-8 -*- """ Created on Mon Jun 17 16:51:46 2019 @author: zfjuan """ import cv2 import dlib img = cv2.imread('.\\image\\keliamoniz1.jpg'); ''' #方法1: # 使用 Dlib 的正面人脸检测器 frontal_face_detector detector = dlib.get_frontal_face_detector() # 使用 detector 检测器来检测图像中的人脸 # use detector of Dlib to detector faces faces = detector(img, 1) print("人脸数 / Faces in all: ", len(faces)) # Traversal every face for i, d