资源简介
能够实现调用摄像头,实时检测人脸,实时注册捕捉照片存入本地,同时多人识别的人脸识别程序的源代码,需要环境为face_recognition,dlib,cv2,numpy等,可自行在pycharm等配置环境。
代码片段和文件信息
import face_recognition
import cv2
import numpy as np
# This is a demo of running face recognition on live video from your webcam. It‘s a little more complicated than the
# other example but it includes some basic performance tweaks to make things run a lot faster:
# 1. Process each video frame at 1/4 resolution (though still display it at full resolution)
# 2. Only detect faces in every other frame of video.
# PLEASE NOTE: This example requires OpenCV (the ‘cv2‘ library) to be installed only to read from your webcam.
# OpenCV is *not* required to use the face_recognition library. It‘s only required if you want to run this
# specific demo. If you have trouble installing it try any of the other demos that don‘t require it instead.
# Get a reference to webcam #0 (the default one)
video_capture = cv2.VideoCapture(0)
# Load a sample picture and learn how to recognize it.
obama_image = face_recognition.load_image_file(“zcx.jpg“)
obama_face_encoding = face_recognition.face_encodings(obama_image)[0]
# Load a second sample picture and learn how to recognize it.
# Create arrays of known face encodings and their names
known_face_encodings = [
obama_face_encoding
]
known_face_names = [
“Barack Obama“
]
# Initialize some variables
face_locations = []
face_encodings = []
face_names = []
process_this_frame = True
while True:
# Grab a single frame of video
ret frame = video_capture.read()
# Resize frame of video to 1/4 size for faster face recognition processing
small_frame = cv2.resize(frame (0 0) fx=0.25 fy=0.25)
# Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses)
rgb_small_frame = small_frame[: : ::-1]
# Only process every other frame of video to save time
if process_this_frame:
# Find all the faces and face encodings in the current frame of video
face_locations = face_recognition.fac
- 上一篇:爬取汽车之家指定配置信息
- 下一篇:Python爬取豆瓣图书信息并保存到本地
相关资源
- widerFace转VOC格式标注工具
- 利用OpenCV检测人脸python程序
- OpenCV-Python实现的图片拼接源代码
- face_detect1.0.py
- 支持向量机SVM python源代码
- python opencv3人脸识别windows
- Python3.x+Pyqt5实现绘图界面MainWindow类型
- Python3.x+Pyqt5实现界面和逻辑分离案例
- python+OpenCV人间检测源码
- python3程序开发指南(第二版)与课后
- python爬取视频源代码
- 弹球小游戏Python源代码
- 基于神经网络和OpenCV的人脸识别系统
- python web py入门配套源代码
- head first python 最新源代码
- 基于区域的图像分割python源代码
- 2048小游戏Python源代码
- Probabilistic Matrix Factorization概率矩阵分
- Head First python 第二版源代码
- 支持向量机SVM——人脸识别
- python模拟登陆163邮箱并获取通讯录.
- python人脸检测源代码
- python所有源代码
- 基于python2.7的LeNet5源代码实现
- Python+OpenCv实现AI人脸识别身份认证系
- Python3.x+Pyqt5实现界面左侧导航栏的抽
- SVM人脸识别的Python代码
- 基于Python的SVM模块源代码
- 卷积神经网络人脸识别.txt
- Python3.x+Pyqt5实现绘图界面matplotlib绘图
评论
共有 条评论