Pro Jest
Pro Jest
A Project Report
By
MINAKSHI KUMARI
Department of Computer
Ranchi
2022
Index Table
Sl. No. Chapter Page
Synopsis
1. 1
Abstract
2. 2
Acknowledgement
3. 3
Certificate of Originality
5. 5
12.
Chapter 2: Literature Survey 15-17
13. 18
Chapter 3: System Requirement
Chapter 4:Overview of Software
14. 19-25
used
15. 4.1 Python 19
24. 30-34
Chapter 7: Testing
25. Chapter 8 : Design 35-40
30. ER-Diagram 40
33. Conclusion 86
35. Bibliography 89
SYNOPSIS
1
ABSTRACT
2
Acknowledgement
Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of the
project.
I would like to show my great appreciation to Prof .Mr. Kamaldeep sir. I can’t say thank
you enough for providing help with required infrastructure. Without your encouragement
and guidance this project would not have materialized. The guidance and support
received from all the faculty members who contributed to this project, was vital for the
success of the project.
Name: Minakshikumari
3
Declaration by the Student
This is to certify that the work presented in the Mini Project titled : “FACE
RECOGNITION ATTENDENCE SYSTEM” in partial fulfillment of the requirement for
the award of degree of BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY (BSC IT), of
Marwari College, Ranchi. The projects written in the project file have been satisfactory
performed by: -
Nikhil kumar
Roll:20MCRBS620069
Date:20-05-2023
Place: Ranchi
4
Certificate of Originality
The foregoing Project Report entitled “FACE RECOGNITION ATTENDENCE
SYSTEM”, is hereby approved as a creditable work and has been presented in satisfactory
manner to warrant its acceptance as prerequisite to the degree for which it has been
submitted.
It is understood that by this approval, the undersigned do not necessarily endorse any
conclusion drawn or opinion expressed therein, but approve the Project Report for
the purpose for which it is submitted.
Nikhil kumar
(Project Guide/Supervisor)
Assistant Professor
5
Chapter 1: Project Description
1.1 Introduction
The technology aims in imparting a tremendous knowledge oriented
technical innovations these days.
Deep Learning is one among the interesting domain that enables the
machine to train itself by providing some datasets as input and provides an
appropriate output during testing by applying different learning algorithms.
So, the problem arises when we think about the traditional process of taking
attendance in the classroom. To solve all these issues we go with Automatic
Attendance System (AAS).
6
It is also possible to recognize whether the student is sleeping or awake
during the lecture and it can also be implemented in the exam sessions to
ensure the presence of the student.
so it becomes highly reliable for the machine to understand the presence of all
the students in the classroom.
Feature-based approach
Brightness-based approach
7
face recognition is gaining more popularity and has been widely used.
The proposed system will reduce the paper work where attendance will no
longer involve any manual recording.
The new system will also reduce the total time needed to do attendance
recording.
▪ Allow new students or staff to store their faces in the database by using
a GUI.
8
▪ Able to show an indication to the user whether the face- recognition
process is successful or not.
The main intention of this project is to solve the issues encountered in the old
attendance system while reproducing a brand new innovative smart system
that can provide convenience to the institution.
Apart from that, a website will be developed to provide visual access to the
information. The followings are the project scopes:
▪ The facial recognition process can only be done for 1 person at a time.
▪ There will be two types of webpage interface after the login procedure
for the admins and the non-admins respectively.
▪ The project has to work under a Wi-Fi coveraged area, as the system need
to update the database of the attendance system constantly.
9
. Therefore, in this project, those limitations will be overcome and also further
improved.
This can not only train the student to be punctual as well as avoids any
immoral ethics such as signing the attendance for their friends.
▪ The institution can save a lot of resources as enforcement are now done by
means of technology rather than human supervision which will waste a lot
of human resources for an insignificant process.
▪ The smart device can operate at any location as long as there is Wi-Fi
coverage which makes the attendance system to be portable to be placed
at any intended location.
For an example, the device can be placed at the entrance of the classroom to
take the attendance.
▪ It saves a lot of cost in the sense that it had eliminated the paper
work completely.
▪ The system is also time effective because all calculations are all
automated. In short, the project is developed to solve the existing issues in
the old attendance system.
The face of the student needs to be captured in such a manner that all
the feature of the students' face needs to be detected.
There is no need for the teacher to manually take attendance in the class
because the system records a video and through further processing
steps the face is being recognized and the attendance database is
updated.
10
This system is developed using python .
The proposed automated attendance system can be divided into five main
modules.
The modules and their functions are defined in this section. The five
modules into which the proposed system is divided are:
Image Capture:
Digital image processing is the use of a digital computer to process digital
images through an algorithm.
Since images are defined over two dimensions (perhaps more) digital image
processing may be modeled in the form of multidimensional systems.
11
Face Detection
A proper and efficient face detection algorithm always enhances the
performance of face recognition systems.
Various algorithms are proposed for face detection such as Face geometry
based methods, Feature Invariant methods, Machine learning based methods.
Out of all these methods Viola and Jones proposed a framework which gives
a high detection rate and is also fast.
Pre-Processing
Database Development
Proposed Algorithm
6. Post-processing
The main task of our proposed system is to detect and recognize the image of
the student and mark the attendance accordingly in the excel file. Also can
capture the new entries if needed. Further our system can perform all the basic
operations like create, read, delete, edit, search etc. The proposed system is
divided into major 3 modules which are as follows:
A. Admin Module
In this module, one has to provide the login credentials which involves id and
password which will be matched with the one that is stored in database.
C. Attendance Module
This will mark the attendance if the face of student match with the database
else not.
E. Deployment Requirements
13
There are various requirements (hardware, software and services) successfully
deploy the system. These are mentioned below:
1) Hardware
– 32-bit, x86 Processing system
– Internet connection
– High- definition Camera
2) Software
– Windows 7 or later operating system or digital device for showing page
– Wamp server
14
Chapter 2
Literature Survey
Approach for Face Detection and Attendence Using Opencv and Machine
learning
The Face detection has been implimented Using a Method Called Histogram of
Oriented Gradents In this system students images are stored in database
folder With Students name. when Any person comes in front of camera it
captures the image of person and compares the captured image with images
present in database Folder if images matches with any of the image in
database folder then the attendance of the student will be marked and stored
in CSV file.
16
nevon[2] marks
attendance
3. Smart Takes pictures Used for Cannot mark
Attendance through the marking attendance of
System using webcam and attendance in the student on
OPENCV based create a schools and a remote sever
on Facial dataset for colleges. database.
Recognition users using m
[3] images. Takes
real-time
images and
mark
attendance
4. Smart Student In this the data Required high
Attendance Registration is stored in definition
Management Face sorted manner camera
System Using Recognition so that it can
Face Addition of easily
Recognition[6] subject with accessible
their
corresponding
time.
Attendance
sheet
generation and
import to Excel
(xlsx) format.
5. Face Face detection, High accuracy Camera should
Recognition - A Pre-processing, be attached at
Tool for Feature a specific
Automated extraction, and position
Attendance] Classification
stages
6. Smart Uses CCTV and 3D face Android phone
Application For Android mobile recognition is expensive
AMS Using algorithm is and detect one
Face used face at time
Recognition[8]
7. Student Use of Discrete Multiple face Success rate is
Attendance Wavelet detection was only 82%
17
System in Transform and possible
Classroom Discrete Cosine
Using Face Transform.
Recognition
Technique[9
8. Attendance In this The problem of Masked faces
System based Illumination light intensity were not
on Face invariant problem and recognized.
Recognition algorithm is head pose was
using Eigen used overcomed.
face and PCA
Algorithms [10]
9. Attendance Open CV This method is Recognition
System Using python libary is fast and secure rate is lower
Face used and Mysql and have low
Recognition is used for false positive
and Class database rate.
Monitoring
System[11]
10. Algorithm for Median filter Multiple faces Accuracy is low
Efficient and skin can be only 50% faces
Attendance classification is detected at a were
Management: used time and no recognized
Face special
Recognition hardware is
based needed
approach[12]
18
Chapter 3
SYSTEM REQUIREMENT
The design part of the attendance monitoring system is divided into two
sections which consist of the hardware and the software part. Before the
software The design part can be developed, the hardware part is first
completed to provide a platform for the software to work. Before the software
part we need to install some libraries for effective working of the application.
We install OpenCV and Numpythrough Python.
Windows 7 or higher
Open Cv
Numpy
Database
Database Server(Wamp)
19
Chapter 4
Overview of Software Used
4.1 Python:-
It is used for:
4.2 Tkinter:-
4.2.1
It is the standard GUI toolkit for Python. Fredrik Lundh wrote it. For modern
Tk binding, Tkinter is Using Tkinter:-implemented as a Python wrapper for
the Tcl Interpreter embedded within the interpreter of Python. Tk provides
the following widgets:
Button
canvas
combo-box
frame
level
check-button
entry
level-frame
menu
list - box
menu button
message
tk_optoinMenu
progress-bar
21
radio button
scroll bar
separator
tree-view, and many more.
4.3 OpenCV:-
22
BACKEND:
MYSQL
My SQL, the most popular Open Source SQL database management
system, is developed,
The logical model, with objects such as databases, tables, views, rows,
and Columns,
The SQL part of “My SQL” stands for “Structured Query Language”.
The SQL standard has been evolving Since 1986 and several versions
exist. In this manual,
released in 1999, and “SQL: 2003” Refers to the current version of the
standard.
24
Mean the current version of the SQL Standard at any time.
Open Source means that it is possible for anyone to use and modify the
software.
Anybody can download the My SQL software from the Internet and use
it without paying Anything.
If you wish, you may study the source code and change it to suit your
needs.
The MySQL Database Server is very fast, reliable, scalable, and easy to
use.
If that is what you are looking for, you should give it a try.
My SQL Server today offers a Rich and useful set of functions. Its
connectivity, speed,
25
and security make My SQL Server highly suited for accessing databases
on the Internet.
WAMP:-
26
Chapter 5
Feasibility Study:
If there was sufficient support for the project from the management and from
theusers.
27
5.2 Technical feasibility:
Does the proposed equipment have the technical capacity for using the new
system?
The observer pattern along with factory pattern will update tthe results
eventually
The system developed and installed will be good benefit to the organization.
The system will be developed and operated in the existing hardware and
software infrastructure.
So, there is noneed of additional hardware and software for the system.
28
Chapter 6
Methodology:-
Before the attendance management system can work, there are a set of data
needed to be inputted into the system which essentially consist of the
individual’s basic information which is their ID and their faces.
The first procedure of portrait acquisition can be done by using the Raspberry
Pi Camera to capture the faces of the individual. In this process the system
will first detect the presence of a face in the captured image,
if there are no face detected, the system will prompt the user to capture
their face again until it meets certain number of portraits which will be 10
required portraits in this project for each student.
After the images are being processed, they are stored into a file in a hierarchy
manner. In this project, all the faces will be stored in a hierarchy manner
under the ‘database’ folder. When expanding through the database folder,
there will consist of many sub-folders which each of them will represent an
individual where a series of face portrait belonging to the same individual will
be stored in that particular sub-folder. The sub-folders that represent each
individual will be named upon the ID no. of that individual which is unique for
every single individual in the institution. The whole process of image retrieval,
pre- processing, storing mechanism is done by the script named
create_database.py.
After a successful retrieval of facial images into the respective folder, a CSV file
is created to aid the next process of pumping the faces into the recognizer for
29
the training process. The creation of the CSV file will be done based on a script
named create_csv.py.
After having sufficient images in the database, those images will then be
inserted into a training mechanism. There are generally 3 different types of
training mechanism provided in OpenCV 3.4 which are EigenFaces, FisherFaces,
and Local Binary Patterns Histograms (LBPH). The recognizer that will be
focused in this project will be the EigenFaces recognizer. The concept behind
EigenFaces is simple – it recognizes a particular face by catching the maximum
deviation in a face and then turning those identified variations into information
to be compared when a new face arrives. In the training process, the csv file
will be read to provide the path to all of the images where those images and
labels will be loaded into a list variable.
Then, the list will be passed into the training function where the training
process will take a measurable time to run.
The larger the face database, the longer the time will be needed to train
those images. In this project there are 40 subjects, which will provide 400
images to be trained that takes approximately 50 seconds for the training
session.
Imagine if the system holds 5000 students there will be 50,000 images in total
to be trained which might takes up roughly 1.30 hours to complete the
training process.
Therefore, to maintain the efficiency of the system, a .yml file will be saved
after the training process so that during the recognition process,
only the .yml file will be loaded instead of repeating the whole training
process.
30
Chapter 7
TESTING
Software testing is a critical element of software quality assurance and
represents the ultimatereviews of specification, design and coding.
No system is error free because it is sotill the next error crops up during
any phase of the development or usage of the product. Asincere effort
however needs to be put to bring out a product that is satisfactory.
After preparing the test data, the systemunder study was tested using those
data. While testing the system, by using the test data, errorswere found and
corrected by using the following testing steps and corrections were also
notedfor future use.
Integration testing
Validation testing
Unit testing
Output testing
User Acceptance testing (beta Testing)
31
Unit testing:
Usingthe unit test plans prepared in the design phase of the system
development as a guide,
The interfacesof the modules are tested to ensure proper flow of information
into and out
All independent paths were exercisedto ensure that all statements in the
module have
been executed at least once and all error-handling paths were tested.
Each unit is thoroughly tested to check if it might fail in any possible situation.
At the end of this testing phase each module isfound to be have an adverse
effect working satisfactorily,
as regard to the expected output fromthe module.
Integration Testing:
32
global data structures can present problems.Integration testing is a systematic
technique for the program structure while at the same timeconcluding tests
to uncover errors associated with interface.
Each of the module is integrated andtested separately and later all modules
are tested together for some time to ensure the systemas a whole works well
without any errors.
Validation Testing:
Output Testing:
33
The output generated or displayed by the system under consideration is
tested by asking theuser about the format required by them, here, the output
format is considered in two ways:
Beta testing is carried output by the client,and minor errors that have
been discovered by the client are rectified to improve the userfriendliness
of the system.
This is thefinal testing performed once the functional, system and regression
testing are completed.
The main purpose of this testing is to validate the software against the
business requirements.
This validation is carried out by the end users who are familiar with the
business requirements.
As user acceptance test is the last testing that is carried out before the
software goes live,obviously this is the last chance for the customer to test the
software and measure if it is fit forthe purpose.
This is typically the last step before the product goes live or before the delivery
ofthe product is accepted. This is performed after the product itself is
thoroughly tested.
Users or client?
This could be either someone who is buying a product (in the case
ofcommercial software)
34
end user if the software is made available to them ahead of the time andwhen
their feedback is sought out.
The team can be comprised of beta testers or the customershould select UAT
members
internally from every group of the organization so that each andevery user
role can be tested accordingly.
Actually speaking, thisis the most important phase of the project as this is the
time at which
the users who are actuallygoing to use the system would validate the system
for its fit to purpose.
UAT is a test phasethat largely depends on the perspective of the end users
and the domain
35
Chapter 8
DATA FLOW DIAGRAM
Student
Validate Details
Enter details
Level 0(DFD)
36
Sign Up
Student
Student
Registration
Registered Student
Image appear on
the window
Face Detection
Provid
e
gener
ate
report
Mark
Attendanc
Face Recognition Attendance Record
Admin Activity
Level 1(DFD)
37
FLOW CHART DIAGRAM
Start
Check continuously
Doesn’t match
Compared
with database
image
Match
End
38
USE-CASE DIAGRAM:-
login
Add Student
Manage Student
Search Student
Take Image
Mark Attendance
Log Out
39
BLOCK DIAGRAM
Manage Student
Attendance Take Image
Search Student
Mark Attendance
Camera
Camera
Face Recognition
Mark Attendance
40
ER-Diagram
Attendance
D_Id
Enrollment Id
D_name Date
Department Attendance
Process
has
Name
belongs
Enrol Id Id no
Admin Id Email
Admin
ID
Student Id
Face Recognition
Account Status Id Number Enrollment
Admin ACCOUNT
Email Department
Face Image
Contact STUDENT
Contact
Name enrol
Password
Gender
User name
41
Chapter 9
PROJECT
OUTLOOK
42
43
REGISTRATION PAGE
44
LOGIN PAGE
45
46
47
48
49
DATA(REGISTRATION)
REGISTRATION TABLE
50
Chapter: 10
CODINGS
fromtkinter import *
fromtkinter import ttk
from PIL import Image,ImageTk
from register import reg
from login import
log defopen_reg():
reg()
defopen_log():
log()
root=Tk()
root.title("HOME!")
root.geometry("1366x768+0+0")
root.config(bg="white")
51
#---BG_IMAGE---
bg=Label(root)
img=Image.open(r"images\bg.jpg")
img=ImageTk.PhotoImage(img)
bg.config(image=img)
bg.image=img
bg.place(x=0,y=0,relheight=1,relwidth=1)
#---ICON_IMAGE---
icon=Label(root)
icon.place(x=80,y=100)
frame1=Frame(root,bg="white")
frame1.place(x=585,y=100,width=700,height=586)
#---INTRODUCTION---
52
title=Label(frame1,text="FACIAL RECOGNITION
SYSTEM",font=("Californian
FB",30,"bold"),bg="white",fg="red").place(x=50,y=30)
desc4=Label(frame1,text="New User!",font=("Californian
FB",18),bg="white").place(x=120,y=350)
desc5=Label(frame1,text="Existing
User!",font=("Californian
FB",18),bg="white").place(x=450,y=350)
#---REGISTER_BUTTON---
reg_btn=Button(frame1)
img=Image.open(r"images\reg.jpg")
53
img=ImageTk.PhotoImage(img)
reg_btn.config(image=img,bd=0,cursor="hand2",command=
open_reg)
reg_btn.image=img
reg_btn.place(x=80,y=400,height=50,width=240)
#---LOGIN_BUTTON---
log_btn=Button(frame1) img=Image.open(r"images\
log.jpg") img=ImageTk.PhotoImage(img)
log_btn.config(image=img,bd=0,cursor="hand2",command=
open_log)
log_btn.image=img
log_btn.place(x=400,y=400,height=50,width=240)
#---QUIT_BUTTON---
q_btn=Button(frame1)
img=Image.open(r"images\quit.jpg")
img=ImageTk.PhotoImage(img)
q_btn.config(image=img,bd=0,cursor="hand2",command=r
oot.destroy)
54
q_btn.image=img
q_btn.place(x=230,y=500,height=50,width=240)
x=1
def
a():
global x img=Image.open(r"images\x"+str(x)
+".png") img=ImageTk.PhotoImage(img)
icon.config(image=img)
icon.image=img
x=x+1
root.after(2000,a)
if x==3:
x=1
a()
root.mainloop()
fromtkinter import*
55
fromtkinter import ttk
fromtkinter import
filedialog
importmysql.connector
import cv2
importface_recognition
importdatetime
t=Tk()
str1=""
d9=""
d1=""
d2=""
p1=""
p2=""
cd=""
t.geometry("1500x1600")
t.configure(bg='light blue')
l=Label(t)
56
l.grid(row=0,column=0)
57
l.place(relx=0.02,rely=0.02)
count=0
def a():
global count
count=count+1
x="C:/Users/lappy/Pictures/f"+str(count)+".jpg"
img=Image.open(x)
img=img.resize((500,690),Image.ANTIALIAS)
img=ImageTk.PhotoImage(img)
l.config(image=img)
l.image=img
if count==4:
count=0
t.after(1000,a)
a()
l1.place(x=780,y=70)
lpic=Label(t)
58
lpic.place(x=650,y=50)
img=Image.open("C:/Users/lappy/Pictures/logo3.png")
img=img.resize((80,80),Image.ANTIALIAS)
img=ImageTk.PhotoImage(img)
lpic.config(image=img)
lpic.image=img
59
Although the accuracy of face recognition systems as a
biometric
l2=Label(t,text=t1,font="Times 18")
l2.place(x=600,y=160)
# Login page
def login():
t1=Toplevel(t)
t1.geometry("1500x1500")
t1.configure(bg='light blue')
defview_att():
global d1
global d2
t3=Toplevel(t1)
t3.geometry("1500x1500")
60
t3.configure(bg='light blue')
lpic=Label(t3)
lpic.place(relx=0.01,rely=0.03)
img=Image.open("C:/Users/lappy/Pictures/logo3.png")
img=img.resize((330,550),Image.ANTIALIAS)
img=ImageTk.PhotoImage(img)
lpic.config(image=img)
lpic.image=img
head=Label(t3,text="Face Recognition
System",fg="#d77337",font="Goudy 26 bold")
head.place(relx=0.32,rely=0.05)
display1.place(relx=0.35,rely=0.14)
x=mysql.connector.connect(host="127.0.0.1",user="root",passwd=
"")
conn=x.cursor()
conn.execute("use
project")
62
res=conn.fetchall()
print(res)
global cd
global d9
pic1=Label(t3)
pic1.place(relx=0.9,rely=0.28)
img=Image.open(d9)
img=img.resize((120,120),Image.ANTIALIAS)
img=ImageTk.PhotoImage(img)
pic1.config(image=img)
pic1.image=img
total_rows = len(res)
total_columns = len(res[0])
fori in range(total_rows):
#e=Entry(t3,width=30,fg='blue',font=('Arial',16,'bold'))
#e.pack(padx=10,pady=10)
for j in range(total_columns):
e=Entry(t3,width=20,fg='blue',font=('Arial',16,'bold'))
e.grid(row=i,column=j)
#e.pack(padx=10,pady=5)
63
e.insert(END,res[i][j])
'''
display2.place(relx=0.35,rely=0.25)
display3.place(relx=0.44,rely=0.25)
display4.place(relx=0.35,rely=0.3)
display5.place(relx=0.44,rely=0.3)
display6.place(relx=0.35,rely=0.35)
64
display7.place(relx=0.44,rely=0.35)
'''
deflogin_verify():
defshow_details():
defopen_cam():
list1=[]
counter=0
global cd
img1=face_recognition.load_image_file(d9)
img1=cv2.cvtColor(img1,cv2.COLOR_BGR2RGB)
encode1=face_recognition.face_encodings(img1)[0]
co=face_recognition.face_locations(img1)[0] cv2.rectangle(img1,
(co[3],co[0]),(co[1],co[2]),(255,0,0),1)
cv2.imshow("video1",img1)
65
cap=cv2.VideoCapture(0)
while True:
rect,frame=cap.read()
frame=cv2.cvtColor(frame,cv2.COLOR_BGR2RGB)
c=face_recognition.face_locations(frame)
e=face_recognition.face_encodings(frame,c)
if(len(c)>0):
(y1,x2,y2,x1)=c[0]
cv2.rectangle(frame,(x1,y1),(x2,y2),(255,0,0),1)
result=face_recognition.compare_faces(encode1,e)
print(result)
list1.append(result)
if result[0] == True:
frame=cv2.putText(frame,"Welcome : "+d1,
(50,50),cv2.FONT_HERSHEY_SIMPLEX,1,(250,0,0),2,cv2.LINE_A A)
counter=counter+1
frame=cv2.putText(frame,"Attendance generated.",
(100,100),cv2.FONT_HERSHEY_SIMPLEX,1,(250,0,0),2,c v2.LINE_AA)
else:
66
cv2.imshow('video2',frame)
if cv2.waitKey(1)&0xff==ord('q'):
break
print(list1)
cap.release()
cv2.destroyAllWindows()
if counter>0:
current_date=datetime.datetime.today().strftime("%d-%m-%Y
%I:%M:%S")
cd=str(current_date)
x=mysql.connector.connect(host="127.0.0.1",user="root",passwd=
"")
conn=x.cursor()
conn.execute("use project")
x.commit()
67
t1=Toplevel(t)
t1.geometry("1500x1500")
t1.configure(bg='light blue')
lpic=Label(t1)
lpic.place(relx=0.01,rely=0.03)
img=Image.open("C:/Users/lappy/Pictures/logo3.png")
img=img.resize((330,550),Image.ANTIALIAS)
img=ImageTk.PhotoImage(img)
lpic.config(image=img)
lpic.image=img
head=Label(t1,text="Face Recognition
System",fg="#d77337",font="Goudy 26
bold")
head.place(relx=0.32,rely=0.05)
disp1.place(relx=0.35,rely=0.14)
x=mysql.connector.connect(host="127.0.0.1",user="root",passwd=
"")
conn=x.cursor()
68
conn.execute("use project")
res=conn.fetchall()
global d9
global d1
global d2
for y in res:
d1=y[0]
d2=y[1]
d3=y[2]
d4=y[3]
d5=y[4]
d6=y[5]
d7=y[6]
d8=y[7]
d9=y[8]
fg="black")
disp2.place(relx=0.35,rely=0.25)
disp4.place(relx=0.35,rely=0.3)
disp5.place(relx=0.44,rely=0.3)
disp6.place(relx=0.35,rely=0.35)
disp7.place(relx=0.44,rely=0.35)
disp8.place(relx=0.35,rely=0.4)
disp9.place(relx=0.44,rely=0.4)
70
disp10=Label(t1,text="Dob: ", font="Goudy 15 bold",
bg="light gray",fg="black")
disp10.place(relx=0.35,rely=0.45)
disp11.place(relx=0.44,rely=0.45)
disp12.place(relx=0.35,rely=0.5)
disp13.place(relx=0.44,rely=0.5)
disp14.place(relx=0.35,rely=0.55)
disp15.place(relx=0.44,rely=0.55)
71
disp17=Label(t1,text=d8, font="Goudy 15 bold", bg="light
gray",fg="black")
disp16.place(relx=0.35,rely=0.6)
disp17.place(relx=0.44,rely=0.6)
pic1=Label(t1)
pic1.place(relx=0.6,rely=0.28)
img=Image.open(d9)
img=img.resize((120,120),Image.ANTIALIAS)
img=ImageTk.PhotoImage(img)
pic1.config(image=img)
pic1.image=img
txt.place(relx=0.35,rely=0.67)
btn=Button(t1,text="Open
camera",font="bold",bg="white",command=open_cam)
btn.place(relx=0.4,rely=0.75)
btn.config(width=12)
72
btn1=Button(t1,text="View
Attendance",font="bold",bg="white",command=view_att)
btn1.place(relx=0.5,rely=0.75)
btn1.config(width=15)
p1=t12.get()
p2=t13.get()
x=mysql.connector.connect(host="127.0.0.1",user="root",passwd=
"")
conn=x.cursor()
conn.execute("use
project")
res=conn.fetchall()
count=0
for y in res:
73
count=count+1
if count==0:
print("Invalid Login")
else:
show_details()
def reset():
t12.delete(0, 'end')
t13.delete(0,'end')
lpic=Label(t1)
lpic.place(relx=0.08,rely=0.03)
img=Image.open("C:/Users/lappy/Pictures/logo3.png")
img=img.resize((330,550),Image.ANTIALIAS)
img=ImageTk.PhotoImage(img)
lpic.config(image=img)
lpic.image=img
74
l1=Label(t1, text="Face Recognition
System",fg="#d77337",font="Goudy 26
bold")
l1.place(relx=0.39,rely=0.05)
head.place(relx=0.43,rely=0.18)
l11.pack()
t12.pack()
l11.place(relx=0.33,rely=0.3)
t12.place(relx=0.43,rely=0.3)
l12.pack()
t13.pack()
l12.place(relx=0.33,rely=0.35)
t13.place(relx=0.43,rely=0.35)
75
b11=Button(t1,text="Login", font="bold",bg="light
gray",command=login_verify)
b11.pack()
b11.config(width=8)
b12=Button(t1,text="Reset", font="bold",bg="light
gray",command=reset)
b12.pack()
b12.config(width=8)
b11.place(relx=0.43,rely=0.43)
b12.place(relx=0.51,rely=0.43)
#Registeration page
def register():
t2=Toplevel(t)
def save():
global p1,p2
p1=ta1.get();
p2=ta6.get();
p3=ta2.get();
p4=ta3.get();
76
p5=ta4.get();
p6=cb1.get();
ifvar.get()==1:
p7="M"
else:
p7="F"
p8=ta7.get();
p9=str1;
x=mysql.connector.connect(host="127.0.0.1",user="root",passwd=
"")
conn=x.cursor()
conn.execute("use project")
conn.execute("insert into
student
values("+"'"+p1+"'"+","+"'"+p2+"'"+","+"'"+p3+"'"+","+"'"+p4+"'"+
","+"'"+p5+"'"+","+"'"+p6+"'"+","+"'"+p7+"'"+","+"'"+p8+"'"+","+"'
"+p9+"'"+")")
x.commit()
77
def reset1():
78
ta1.delete(0,'end')
ta2.delete(0,'end')
ta3.delete(0,'end')
ta4.delete(0,'end')
ta6.delete(0,'end')
ta7.delete(0,'end')
cb1.delete(0,'end')
t2.geometry("1500x1500")
t2.title('REGISTRATION FORM')
t2.configure(bg='light blue')
lpic=Label(t2)
lpic.place(relx=0.01,rely=0.03)
img=Image.open("C:/Users/lappy/Pictures/logo3.png")
img=img.resize((330,550),Image.ANTIALIAS)
img=ImageTk.PhotoImage(img)
lpic.config(image=img)
lpic.image=img
79
l1=Label(t2, text="Face Recognition
System",fg="#d77337",font="Goudy 26
bold")
l1.place(relx=0.3,rely=0.03)
L.place(relx=0.3,rely=0.1)
lb1.place(relx=0.3,rely=0.2)
ta1.place(relx=0.43,rely=0.2)
lb6.place(relx=0.3,rely=0.25)
ta6.place(relx=0.43,rely=0.25)
ta2.place(relx=0.43,rely=0.3)
lb3.place(relx=0.3,rely=0.35)
ta3.place(relx=0.43,rely=0.35)
lb4.place(relx=0.3,rely=0.4)
ta4.place(relx=0.43,rely=0.4)
lb5=Label(t2,text="Course : ",font="bold",bg="light
gray",fg="blue")
lb5.grid(row=7,column=0)
lb5.place(relx=0.3,rely=0.45)
cb1=ttk.Combobox(t2,height=3,width=34)
81
cb1.grid(row=6,column=1)
cb1.place(relx=0.43,rely=0.45)
cb1['value']=('BSC','BA','BCA','IT','MCA','BCOM')
cb1.current(0)
lb6=Label(t2,text="Gender",font="bold",fg="blue",bg="light
gray")
lb6.grid(row=7,column=0)
lb6.place(relx=0.3,rely=0.5)
var=IntVar()
r1=Radiobutton(t2,text="Male",variable=var,value=1)
r2=Radiobutton(t2,text="Female",variable=var,value=2)
r1.grid(row=7,column=1)
r2.grid(row=7,column=2)
r1.place(relx=0.43,rely=0.5)
r2.place(relx=0.5,rely=0.5)
lb7=Label(t2,text="Session:",font="bold",fg="blue",bg="light
gray",)
lb7.place(relx=0.3,rely=0.55)
ta7.place(relx=0.43,rely=0.55)
82
# browse a file
lpic1=Label(t2)
lpic1.place(relx=0.75,rely=0.22)
defuploadfile():
global str1
f1=filedialog.askopenfilename()
str1=f1
img1=Image.open(f1)
img1=img1.resize((120,120),Image.ANTIALIAS)
img1=ImageTk.PhotoImage(img1)
lpic1.config(image=img1)
lpic1.image=img1
print("selected",f1)
ta8.place(relx=0.3,rely=0.65)
ta8.config(width=12,height=1)
83
b1=Button(t2,text="Reset",font="bold", bg="dark gray",
borderwidth=3,command=reset1)
b1.place(relx=0.4,rely=0.65)
b1.config(width=12,height=1)
b2.place(relx=0.5,rely=0.65)
b2.config(width=12,height=1)
#Main-Log in button
b1.config(width=14, height=2)
b1.grid(row=2,column=0)
b1.place(x=760,y=600)
#Main-Register button
b2=Button(t,text="Register",font="Goudy 15 bold",
bg="white",borderwidth=3,command=register)
b2.config(width=14, height=2)
b2.grid(row=2,column=1)
b2.place(x=990,y=600)
84
fromtkinter import *
fromtkinter import ttk
from PIL import Image,ImageTk
from register import reg
from login import
log defopen_reg():
reg()
defopen_log():
log()
root=Tk()
root.title("HOME!")
root.geometry("1366x768+0+0")
root.config(bg="white")
#---BG_IMAGE---
bg=Label(root)
85
img=Image.open(r"images\bg.jpg")
img=ImageTk.PhotoImage(img)
bg.config(image=img)
bg.image=img
bg.place(x=0,y=0,relheight=1,relwidth=1)
#---ICON_IMAGE---
icon=Label(root)
icon.place(x=80,y=100)
frame1=Frame(root,bg="white")
frame1.place(x=585,y=100,width=700,height=586)
#---INTRODUCTION---
title=Label(frame1,text="FACIAL RECOGNITION
SYSTEM",font=("Californian
FB",30,"bold"),bg="white",fg="red").place(x=50,y=30)
86
desc1=Label(frame1,text="This is a Facial Recognition
System for students. Here",font=("Californian
FB",18),bg="white").place(x=80,y=100)
desc2=Label(frame1,text="students can mark attendance
and detect mask by recognising",font=("Californian
FB",18),bg="white").place(x=55,y=150)
desc3=Label(frame1,text="recognising individual
faces.",font=("Californian
FB",18),bg="white").place(x=210,y=200)
desc4=Label(frame1,text="New User!",font=("Californian
FB",18),bg="white").place(x=120,y=350)
desc5=Label(frame1,text="Existing
User!",font=("Californian
FB",18),bg="white").place(x=450,y=350)
#---REGISTER_BUTTON---
reg_btn=Button(frame1)
img=Image.open(r"images\reg.jpg")
img=ImageTk.PhotoImage(img)
reg_btn.config(image=img,bd=0,cursor="hand2",command=
open_reg)
87
reg_btn.image=img
reg_btn.place(x=80,y=400,height=50,width=240)
#---LOGIN_BUTTON---
log_btn=Button(frame1) img=Image.open(r"images\
log.jpg") img=ImageTk.PhotoImage(img)
log_btn.config(image=img,bd=0,cursor="hand2",command=
open_log)
log_btn.image=img
log_btn.place(x=400,y=400,height=50,width=240)
#---QUIT_BUTTON---
q_btn=Button(frame1)
img=Image.open(r"images\quit.jpg")
img=ImageTk.PhotoImage(img)
q_btn.config(image=img,bd=0,cursor="hand2",command=r
oot.destroy)
q_btn.image=img
q_btn.place(x=230,y=500,height=50,width=240)
88
x=1
def
a():
global x img=Image.open(r"images\x"+str(x)
+".png") img=ImageTk.PhotoImage(img)
icon.config(image=img)
icon.image=img
x=x+1
root.after(2000,a)
if x==3:
x=1
a()
root.mainloop()
89
Conclusion
Before the development of this project. There are many loopholes in the
process of taking attendance using the old method which caused many
troubles to most of the institutions.
By using technology to conquer the defects cannot merely save resources but
also reduces human intervention in the whole process by handling all the
complicated task to the machine.
The only cost to this solution is to have sufficient space in to store all the faces
into the database storage. Fortunately, there is such existence of micro SD
that can compensate with the volume of the data. In this project, the face
database is successfully built.
Apart from that, the face recognizing system is also working well.
At the end, the system not only resolve troubles that exist in the old model but
also provide convenience to the user to access the information collected by
mailing the attendance sheet to the respected faculty.
90
FUTURE ENHANCEMENTS AND SCOPE
Get an ID card with name, class, ID, Barcode and Photo on it.
91
FUTURE SCOPE
in near futurewe could build a system which would be robust and would work
in undesirable conditions too.
which can be an aid for common people to know about any person being
photographed by
92
BIBLIOGRAPHY
https://nevonprojects.com/face-recognition-attendance-system/
https://www.researchgate.net/publication/341870242_Smart_Attendan
ce_System_using_OPENCV_based_on_Facial_Recogniton
www.geeksforgeeks.org
www.w3scools.in
www.tutorialspoint.com
www.quora.com
93