当前位置:网站首页>Class head up rate detection based on face recognition
Class head up rate detection based on face recognition
2022-07-08 00:41:00 【biyezuopinvip】
Resource download address :https://download.csdn.net/download/sheziqiong/85948238
Resource download address :https://download.csdn.net/download/sheziqiong/85948238
Head up rate detection system
This warehouse designs and implements a simple head rate detection system , Get the real-time image of the classroom by calling the camera , Face recognition on images , And calculate the real-time rise rate of the class in combination with the number of students in the database . Besides , We also designed a UI interface , For managers to browse and manage .
This warehouse contains the following contents :
- All the source code needed for the system to run ( share ipython and py Two file formats , Can operate independently and completely )
- Face recognition requires good training
- Pictures and data needed to run the test
Content abstract
Code function introduction
This document only describes .ipython file , Corresponding .py The document will not repeat , The content is the same .
camera.ipynb
This code realizes calling the camera to intercept the image at a certain time , And store it locally .
code0_initial.ipynb
This code is the original body code , Face recognition mainly refers to dlib A sample program of , There are still some original English comments in the code , Explain the possible problems in the environment configuration , If you are interested, you can have a look .
code1_window_and_face_recognition.py.ipynb
This code is the first relatively complete code , It has been able to run completely , And brought UI Interface .
code2_password_final.ipynb
Just like the file name of this code , It is the login interface added to the code of the previous version , And improve the functions of the code , It is the final code used in this system . It's too troublesome not to look at the first two versions of the code , Just look at the final version .
The code is mainly composed of three parts : Interface code 、 Face detection code and data call code .
Interface code is used tkinter library , Face detection code is also called directly opencv A human face detection interface , Call the trained model and directly check the picture infer That's it . Data calling code mainly calls two kinds of data , They are classroom information and real-time pictures of the classroom . The former is used for head up rate detection , The latter is used to display the real-time image of the classroom on UI On the interface , For observation and comparison .
Key code explanation
In fact, the whole code is also relatively simple , There's nothing to talk about , It's basically the code of the interface , Let me talk about the core functions , Face detection function .
def inspect(): ## Declare a function
nonlocal face ## take face Variables are defined as global , So you don't have to face to return 了 , What comes out of the function face value , You can also get , Can guarantee face Worth real-time
str1 = " classroom "
str2 = " The rise rate in class is :"
path = r'.\faces' ## The path to save the picture
pic_path = str(class_room_chosen.get()) + str(course_time_chosen.get()) + '.jpg' ## Get the name of the corresponding picture according to the selected classroom and time ( The name of the picture needs to be named according to certain rules , Otherwise, an error will be reported )
p = path + '/' + pic_path ## Splice the total path of the image with the name of a single image , Get the path of a single image
img = cv2.imread(p) ## Read the picture
color = (0, 255, 0)
grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ## Only select the image data of a single channel for processing , Is to turn the color image into a gray-scale image
classfier = cv2.CascadeClassifier(
r".\haarcascade_frontalface_alt2.xml") ## Create a classifier , This classifier is already trained , Call a trained model file
faceRects = classfier.detectMultiScale(grey, scaleFactor=1.2, minNeighbors=3, minSize=(32, 32)) ## Face recognition of images through classifiers
a = len(faceRects) ## faceRects There are several pieces of data , It means that there are several faces , So we can judge how many people are looking up
face = a
str3 = str(a) ## Change data format , So that it can be output in UI On the interface
Operation description and result display
Operating instructions
Coding language :python3.7
Programming environment : Jupyter notebook
The main dependency Library : Opencv
Result display
The first is the login interface :
Because of time , This system does not really realize the password verification function , Interested partners can combine MySQL Database and so on to realize this function .
The second is the initialization interface of the system , That is, the interface you will jump to after logging in :
Finally, the result display screen of the head up rate , After selecting the corresponding classroom and time , Click the two buttons on the interface in turn , You can show the rise rate , And the real-time image of the classroom is displayed on the side :
Resource download address :https://download.csdn.net/download/sheziqiong/85948238
Resource download address :https://download.csdn.net/download/sheziqiong/85948238
边栏推荐
- 哪个券商公司开户佣金低又安全,又靠谱
- If an exception is thrown in the constructor, the best way is to prevent memory leakage?
- Smart regulation enters the market, where will meituan and other Internet service platforms go
- paddle入门-使用LeNet在MNIST实现图像分类方法二
- 攻防世界Web进阶区unserialize3题解
- Installation and configuration of sublime Text3
- Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
- 深潜Kotlin协程(二十二):Flow的处理
- 深潜Kotlin协程(二十三 完结篇):SharedFlow 和 StateFlow
- Codeforces Round #804 (Div. 2)(A~D)
猜你喜欢
1293_ Implementation analysis of xtask resumeall() interface in FreeRTOS
【愚公系列】2022年7月 Go教学课程 006-自动推导类型和输入输出
How to learn a new technology (programming language)
Smart regulation enters the market, where will meituan and other Internet service platforms go
What has happened from server to cloud hosting?
Cause analysis and solution of too laggy page of [test interview questions]
paddle一个由三个卷积层组成的网络完成cifar10数据集的图像分类任务
Course of causality, taught by Jonas Peters, University of Copenhagen
52岁的周鸿祎,还年轻吗?
去了字节跳动,才知道年薪 40w 的测试工程师有这么多?
随机推荐
Jouer sonar
1293_FreeRTOS中xTaskResumeAll()接口的实现分析
从服务器到云托管,到底经历了什么?
new和delete的底层原理以及模板
取消select的默认样式的向下箭头和设置select默认字样
玩转Sonar
Reentrantlock fair lock source code Chapter 0
深潜Kotlin协程(二十三 完结篇):SharedFlow 和 StateFlow
Thinkphp内核工单系统源码商业开源版 多用户+多客服+短信+邮件通知
fabulous! How does idea open multiple projects in a single window?
Is 35 really a career crisis? No, my skills are accumulating, and the more I eat, the better
【愚公系列】2022年7月 Go教学课程 006-自动推导类型和输入输出
Solution to prompt configure: error: curses library not found when configuring and installing crosstool ng tool
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
2022-07-07:原本数组中都是大于0、小于等于k的数字,是一个单调不减的数组, 其中可能有相等的数字,总体趋势是递增的。 但是其中有些位置的数被替换成了0,我们需要求出所有的把0替换的方案数量:
爬虫实战(八):爬表情包
某马旅游网站开发(登录注册退出功能的实现)
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
The underlying principles and templates of new and delete
ReentrantLock 公平锁源码 第0篇