A face recognition authentication system based on PyQt5 + Python3.7 + OpenCV, with source code attached.
Technology selection
- PyQt5 + Python3.7 + OpenCV
Functional Overview
Realize personnel registration, information modification, and facial recognition to obtain relevant information
Personnel information is stored in the datafile.txt file through serialization
haarcascade_frontalface_default.xml is the training model that comes with OpenCV
font.ttf is a font file introduced to display Chinese in cv2
Operating environment
- Python3.7
- PyQt5
- Development environment: Windows11 + PyCharm
- 依赖: PyQt5 PyQt5-tools Pillow numpy opencv-python opencv-contrib-python matplotlib
- Packaging: pyinstaller
User manual
Main interface
Face registration
Take about 60 pictures continuously and train the model after grayscale processing. The data is saved in Face_training/trainer.yml
At the same time , the datafile file is rewritten to persist user data.
Information editing
Read the datafile file, instantiate it as a student object, then modify the information and persist it
Identity detection
Identify the person number through OpenCV and determine the relevant person information based on the number
Summarize
- Secondary processing of images through the Pillow module solves the problem that OpenCV.puttext cannot display Chinese names
- Modify the step update time of ProcessBar to solve the problem of abnormal program termination.
- Save personnel identity information through pickle serialization to achieve data persistence
- Use the pyinstaller module to implement exe packaging
- Added new personnel information editing interface
Source code download
Download link: https://pan.baidu.com/s/1SifOapFQru06EJ2jPan3iA?pwd=64fw
Extraction code: 64fw