0% found this document useful (0 votes)
37 views96 pages

Pro Jest

The document outlines a project report for a Face Recognition Attendance System developed by Minakshi Kumari as part of her Master's degree. The system aims to automate attendance tracking using facial recognition technology, significantly reducing time and manual errors associated with traditional methods. It utilizes algorithms like Histogram of Oriented Gradients (HOG) for face detection and SVM for identification, achieving a high accuracy rate of 99.38%.

Uploaded by

nggupta741
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views96 pages

Pro Jest

The document outlines a project report for a Face Recognition Attendance System developed by Minakshi Kumari as part of her Master's degree. The system aims to automate attendance tracking using facial recognition technology, significantly reducing time and manual errors associated with traditional methods. It utilizes algorithms like Histogram of Oriented Gradients (HOG) for face detection and SVM for identification, achieving a high accuracy rate of 99.38%.

Uploaded by

nggupta741
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 96

FACE RECOGNITION ATTENDENCE SYSTEM

A Project Report

Submitted in partial fulfillment of the

Requirements for the award of the degree

of Master of Computer Application

By

MINAKSHI KUMARI

Examination Roll Number: 19PGMCA04708

Department of Computer

Science St. Xavier’s College,

Ranchi

2022
Index Table
Sl. No. Chapter Page
Synopsis
1. 1

Abstract
2. 2

Acknowledgement
3. 3

Declaration by The Student


4. 4

Certificate of Originality
5. 5

Chapter 1:Project Description


6. 6-14

7. 1.1 Introduction 6-7

8. 1.2 Objective 8-9

9. 1.3 Project Scope & Direction 9

10. 1.4 Impact ,Significance 9-10

11. 1.5 Proposed Work 10-14

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

16. 4.2 Tkinter 20

17. 4.3 OpenCV 21

18. 4.4 Mysql 22-25


19. 26-27
Chapter 5:Feasibility Study
20. 5.1 Operational Feasibility 26

21. 5.2 Technical Feasibility 26

22. 5.3 Financial and Economical 27

23. Chapter 6:Methodology


28-29

24. 30-34
Chapter 7: Testing
25. Chapter 8 : Design 35-40

26. Dataflow Diagram 35-36


27 Flowchart Diagram 37

28. Usecase Diagram 38

29. Block Diagram 39

30. ER-Diagram 40

31. Chapter 9: Project Outlook 41-49

32. Chapter 10: Coding 50-85

33. Conclusion 86

34. Future Scope 87-88

35. Bibliography 89
SYNOPSIS

Attendance plays an important role in any organisation whether it be


educational institutions or companies. So it is very important to keep record of
the attendance. The problem arises when one has to manually take the
attendance which is not only time consuming but exhausting as well.
So an automatic attendance system can solve such problem.
Basically, there are two kinds of system:
1) Manual Attendance System (MAS)
2) Automated Attendance System (AAS)

One of AAS system is biometric technique using finger prints, though it is


automatic and a step ahead of traditional method it fails to meet the time and
hygiene constraint. But using the biometric features of face solves such
problem.[1]Our projects emphasizes on the features of the face like ears, nose
etc.
We used a method invented in 2005 called Histogram of Oriented Gradients
(HOG) for face detection.
For identifying the name of person simple linear SVM Classifier is used. All we
need to do is train a classifier that can take in the measurements from a new
test image and tells which known person is the closest match. The result is the
name of person which is used to mark attendance.

1
ABSTRACT

The conventional attendance system consists of registers marked by teachers


which leads to human error and a lot of maintenance. Time consumption is an
important point of concern in this system. We have thought of revolutionize it
using available digital tools in the modern era i.e. FACE RECOGNITION. Our
project will ensure more precision and negligible manual work. The project is
revolutionized in order to overcome the problems of conventional system. Face
recognition and then marking the attendance is our project all about. The
database of all the students in the class is stored in a folder and when the face of
the individual student matches with one of the faces stored image, attendance is
marked else the face is ignored and attendance not marked. In our project, face
recognition (Machine Learning) technology is used .Inside this Histogram of
Oriented Gradient for face detection and SVM Classifier for name recognition
is used. The model has an accuracy of 99.38% on the Labelled Faces in the
Wild benchmark.
Keywords- Face Detection, Face Recognition, OpenCV, Tkinteretc

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.

I am grateful for their constant support and help.

Name: Minakshikumari

Roll No.: 19PGMCA04708

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

Roll no: 20MCRBS620069

(Project Guide/Supervisor)

Assistant Professor

Marwari College, Ranchi

(Internal Examiner) (External Examiner) (ExternalExaminer2)

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.

Nowadays Attendance is considered as an important factor for both the


student as well as the teacher of an educational organization.

With the advancement of the deep learning technology the machine


automatically detects the attendance performance of the students and
maintains a record of those collected data.

In general, the attendance system of the student can be maintained in two


different forms namely,

 Manual Attendance System (MAS)

 Automated Attendance System (AAS).

Manual Student Attendance Management system is a process where a teacher


concerned with the particular subject need to call the students name and
mark the attendance manually.

Manual attendance may be considered as a time-consuming process or


sometimes it happens for the teacher to miss someone or students
may answer multiple times on the absence of their friends.

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).

Automated Attendance System (AAS) is a process to automatically estimate


the presence or the absence of the student in the classroom by using face
recognition technology.

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.

The presence of the students can be determined by capturing their faces on


to a highdefinition monitor video streaming service,

so it becomes highly reliable for the machine to understand the presence of all
the students in the classroom.

The two common Human Face Recognition techniques are,

 Feature-based approach

 Brightness-based approach

The Feature-based approach also known as local face recognition system,


used in pointing the key features of the face like eyes, ears, nose, mouth,
edges, etc.,

whereas the brightness-based approach also termed as the global face


recognition system, used in recognizing all the parts of the image.

Face recognition has set an important biometric feature, which can be


easily acquirable and is non-intrusive.

Face recognition based systems are relatively oblivious to various facial


expression.

Face recognition system consists of two categories: verification and face


identification.

Face verification is an 1:1 matching process, it compares face image


against the template face images and whereas is an 1:N problems that compares
a query face images [1].

The purpose of this system is to build a attendance system which is based on


face recognition techniques.

Here face of an individual will be considered for marking attendance.


Nowadays,

7
face recognition is gaining more popularity and has been widely used.

1.2 Project Objectives


In order to solve the drawbacks of the previous system stated in 1.1, the
existing system will need to evolve.

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.

The new system will acquire individual attendance by means of facial-


recognition to secure data accuracy of the attendance.

The followings are the objectives of this project:

▪ To develop a portable Smart Attendance System which is handy and self-


powered.

▪ To ensure the speed of the attendance recording process is faster than


the previous system which can go as fast as approximately 3 second for
each student.

▪ Have sufficient memory space to store the database.

▪ Able to recognize the face of an individual accurately based on the


face database.

▪ Allow parents to track their child’s attendance.

▪ Develop a database for the attendance management system.

▪ Provide a user friendly web interface for admins to access the


attendance database and for non-admins (parents) to check their child’s
attendance.

▪ 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.

1.3 Project Scope and Direction

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.

In this project, a smart device will be developed which is capable of


recognising the identity of each individuals and eventually record down the
data into a database system.

Apart from that, a website will be developed to provide visual access to the
information. The followings are the project scopes:

▪ The targeted groups of the attendance monitoring system are the


students and staff of an educational institution.

▪ The database of the attendance management system can hold up to


2000 individual’s information.

▪ 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.

▪ The smart device is powered up by power bank to improve the portability


of the device.

1.4 Impact, significance and contributions


Many attendance management systems that exist nowadays are lack of
efficiency and information sharing

9
. Therefore, in this project, those limitations will be overcome and also further
improved.

The impact and the contribution of this project is as follow:

▪ Students will be more punctual on attending classes. This is due to the


attendance of a particular student can only be taken personally where
any absentees will be noticed by the system.

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.

1.5. Proposed Work


The task of the proposed system is to capture the face of each student
and to store it in the database for their attendance.

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 .

Systems design is the process of defining the architecture, components,


modules, interfaces, and data for a system to satisfy specified
requirements. Systems design could be seen as the application of systems
theory to product development.

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.

As a subcategory or field of digital signal processing, digital image processing


has many advantages over analog image processing.

It allows a much wider range of algorithms to be applied to the input data


and can avoid problems such as the build-up of noise and distortion during
processing.

Since images are defined over two dimensions (perhaps more) digital image
processing may be modeled in the form of multidimensional systems.

The generation and development of digital image processing are mainly


affected by three factors: first, the development of computers;

second, the development of mathematics (especially the creation and


improvement of discrete mathematics theory);

third, the demand for a wide range of applications in environment,


agriculture, military, industry and medical science has increased.

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.

Viola-Jones detection algorithm is efficient for real time application as it is


fast and robust. Hence we chose Viola-Jones face detection algorithm which
makes use of Integral Image and AdaBoost learning algorithm as classier.

We observed that this algorithm gives better results in different lighting


conditions and we combined multiple haar classifiers to achieve a better
detection rates up to an angle of 30 degrees.

 Pre-Processing

The detected face is extracted and subjected to preprocessing. This pre-


processing step involves with histogram equalization of the extracted face
image and is resized to 100x100.

Histogram Equalization is the most common Histogram Normalization


technique.

This improves the contrast of the image as it stretches the range of


the intensities in an image by making it more clear.

 Database Development

As we chose biometric based system enrolment of every individual is required.


This database development phase consists of image capture of every
individual
12
and extracting the bio-metric feature, in our case it is face, and later it is
enhanced using pre-processing techniques and stored in the database.

 Proposed Algorithm

1. Capture the Student’s Image

2. Apply Face detection algorithms to detect face

3. Extract the Region Of Interest in Rectangular Bounding Box

5. if Enrollment Phase then Store in Database else Apply PCA/LDA/LBPH (For


feature Extraction) Apply Distance Classifier/SVM/Bayesian (for
Classification) end if

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.

B. Student Detail Module


Student details like enrollment, name etc can be edited, added, update, delete
and can search student based on details.

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.

– Marking attendance using face recognition

Automated Attendance system using Face recognition proposes that the


system is based on face detection and recognition algorithm which is used to
detect the student face when he/she come in front of camera and then
compare the face with the images present in the folder if the match is found it
will mark the attendance. This system has advantage over the traditional
system as it saves time and there is no chance of proxy (that is no other
student will mark the attendance of his/her friends).

– Email notification for any Information


Attendance System proposes a feature of Email notification by which users can
get details about their attendance through Email on their respective google
account.

. S. no. Existing System Features Benefits Limitations


1. Automated Use Eigen faces High accuracy Multiple faces
attendance for Recognition were not
management recognized.
system using
face
recognition
[1]
2. Face Stores the Used for Don’t
recognition faces that security recognize
attendance are detected purposes in properly in
15
system by and organizations poor light.
automatically

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.

3.1 Hardware Specification:-

 Camera Module with good mega pixels.


 Intel Core Processing i5 or above.
 8GB RAM minimum recommended.
 High resolution camera
 System type :- 64-bit operating system, x64-based processor

3.2 Software Requirement:-

 Windows 7 or higher

 Python idle(version 3.6)

 Open Cv

 Numpy

 Database

 Database Server(Wamp)

19
Chapter 4
Overview of Software Used
4.1 Python:-

4.1.1 What is Python?


Python is a popular programming language. It was created by Guido van
Rossum, and released in 1991.

It is used for:

 web development (server-side),


 software development,
 mathematics,
 system scripting.

4.1.2 What can Python do?

 Python can be used on a server to create web applications.


 Python can be used alongside software to create workflows.
 Python can connect to database systems. It can also read and
modify files.
 Python can be used to handle big data and perform
complex mathematics.
 Python can be used for rapid prototyping, or for production-ready
software development.

4.1.3 Why Python?

 Python works on different platforms (Windows, Mac, Linux,


Raspberry Pi, etc).
 Python has a simple syntax similar to the English language.
 Python has syntax that allows developers to write programs with
fewer lines than some other programming languages.
 Python runs on an interpreter system, meaning that code can be
executed as soon as it is written. This means that prototyping can
be very quick.
 Python can be treated in a procedural way, an object-oriented way or
a functional way.
20
4.1.4 Python Syntax compared to other programming languages

 Python was designed for readability, and has some similarities to


the English language with influence from mathematics.
 Python uses new lines to complete a command, as opposed to
other programming languages which often use semicolons or
parentheses.
 Python relies on indentation, using whitespace, to define scope; such as
the scope of loops, functions and classes. Other programming
languages often use curly-brackets for this purpose.

4.2 Tkinter:-

 Python offers multiple options for developing GUI (Graphical User


Interface). Out of all the GUI methods, tkinter is the most commonly
used method. It is a standard Python interface to the Tk GUI toolkit
shipped with Python. Python with tkinter is the fastest and easiest way
to create the GUI applications.

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.2.2 Creating a GUI program using this Tkinter is simple. For


this, programmers need to follow the steps mentioned below:

1. Import the module Tkinter


2. Build a GUI application (as a window)
3. Add those widgets that are discussed above
4. Enter the primary, i.e., the main event's loop for taking action when
the user triggered the event.

4.3 OpenCV:-

OpenCV is a huge open-source library for computer vision, machine


learning, and image processing. OpenCV supports a wide variety of
programming languages like Python, C++, Java, etc. It can process
images and videos to identify objects, faces, or even the handwriting
of a human.
When it is integrated with various libraries,
such as Numpy which is a highly optimized library for numerical
operations, then the number of weapons increases in your Arsenal
i.e whatever operations one can do in Numpy can be combined with
OpenCV.

22
BACKEND:

The back end is implemented using MySQL which is used to design


the databases.
MySQL:

Mysql is the world's second most widely used open-source relational


database management system (RDBMS). The SQL phrase stands for
Structured Query Language.

Application software called Navigate was used to design the tables in


MySQL.

MYSQL
My SQL, the most popular Open Source SQL database management
system, is developed,

Distributed, and supported by Oracle Corporation.

MySQL is a database management system.

A database is a structured collection of data.

It may be anything from a simple shopping list to a picture gallery or


the vast amounts of information in a corporate network.

To add, Access, and process data stored in a computer database, you


need a database management

System such as MySQL Server. Since computers are very good at


handling large amounts

Of data, database management systems play a central role in


computing, as standalone

Utilities, or as parts of other applications.

My SQL databases are relational.

A relational database stores data in separate tables rather than putting


all the data in one Big storeroom.
23
The database structures are organized into physical files optimized for
Speed.

The logical model, with objects such as databases, tables, views, rows,
and Columns,

offers a flexible programming environment.

You set up rules governing the Relationships between different data


fields, such as one-to-one, one-to-many, unique, Required or optional,
and “pointers” between different tables.

The database enforces these Rules, so that with a well-designed


database, your application never sees inconsistent, Duplicate,
orphan, out-of-date, or missing data.

The SQL part of “My SQL” stands for “Structured Query Language”.

SQL is the most Common standardized language used to access


databases. Depending on your

Programming environment, you might enter SQL directly (for example,


to generate Reports),

embed SQL statements into code written in another language, or use a


language specific API

that hides the SQL syntax.

SQL is defined by the ANSI/ISO SQL Standard.

The SQL standard has been evolving Since 1986 and several versions
exist. In this manual,

“SQL-92” refers to the standard Released in 1992, “SQL: 1999” refers to


the standard

released in 1999, and “SQL: 2003” Refers to the current version of the
standard.

We use the phrase “the SQL standard” to

24
Mean the current version of the SQL Standard at any time.

My SQL software is Open Source

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 can run Comfortably on a desktop or laptop, alongside


your other applications

, web servers, and So on, requiring little or no attention.

If you dedicate an entire machine to My SQL, you 18 Can adjust the


settings to take advantage

of all the memory, CPU power, and I/O capacity Available.

MySQL can also scale up to clusters of machines, networked together

My SQL Server was originally developed to handle large databases much


faster than existing Solutions

and has been successfully used in highly demanding production


environments For several years.

Although under constant development,

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.

My SQL Server works in client/server or embedded systems.

The My SQL Database Software is a client/server system that consists of


a multithreaded

SQL server that supports different backend, several different client


programs

And libraries, administrative tools, and a wide range of application


programming Interfaces (APIs).

We also provide MySQL Server as an embedded multi-threaded library


that you can link Into

your application to get a smaller, faster, easier-to-manage standalone


product.

A large amount of contributed MySQL software is available.

MySQL Server has a practical set of features developed in close


cooperation with our Users.

It is very likely that your favorite application or language supports the


MySQL.

WAMP:-

Stands for "Windows, Apache, MySQL, and PHP." WAMP


is a variation of LAMP for Windows systems and is often
installed asa software bundle (Apache, MySQL, and
PHP). It is often used For web development and internal
testing, but may also be used toserve live websites.

26
Chapter 5

Feasibility Study:

A feasibility study is a high-level capsule version of the entire System analysis


and DesignProcess.

The study begins by classifying the problem definition.

Feasibility is to determine ifit’s worth doing. Once an acceptance


problem definition has been generated, the analystdevelops a logical
model of the system.

A search for alternatives is analyzed

carefully. Thereare 3 parts in feasibility study.

5.1 Operational Feasibility:

Question that going to be asked are:

Will the system be used if it developed and implemented?

If there was sufficient support for the project from the management and from
theusers.

Have the users been involved in planning and development of

theProject.Will the system produce poorer result in any respect or area?

This system can be implemented in the organization because there is


adequate support frommanagement and users.

Being developed in Python so that the necessary operations are carriedout


automatically.

27
5.2 Technical feasibility:

Does the necessary technology exist to do what is been suggested?

Does the proposed equipment have the technical capacity for using the new
system?

Are there technical guarantees of accuracy, reliability and data

security? The project is developed on Pentium IV with 256 MB RAM.

The environment required in the development of system is any windows


platform

The observer pattern along with factory pattern will update tthe results
eventually

The language used in the development is PYTHON 3.6 & Windows


Environment.

5.3 Financial and Economic Feasibility:

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.

The decision of storing only 10 portrait per student is due to the


consideration of the limited storage space in the raspberry pi because the
total amount of students in the university is considered heavy.

Then, the images will undergo several pre-processing procedures to obtain a


grayscale image and cropped faces of equal sized images because those are
the prerequisites of using the EigenFaces Recognizer.

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.

Testing represents an interesting anomaly for thesoftware. During earlier


definition and development phases, it was attempted to build softwarefrom
an abstract concept to a tangible implementation.

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.

The testing phase involves the testing of development system using


various data. Preparationof the test data plays a vital role in system
testing.

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.

Thus, a series of testing is performed on the proposed system before the


systemis ready for implementation.

The various types of testing done on the system are:

 Integration testing

 Validation testing
 Unit testing
 Output testing
 User Acceptance testing (beta Testing)

31
Unit testing:

Unit testing focuses on verification effort on the smallest unit of software


design module.

Usingthe unit test plans prepared in the design phase of the system
development as a guide,

importantcontrol paths are tested to uncover errors within the boundary of


the modules.

The interfacesof the modules are tested to ensure proper flow of information
into and out

of the modulesunder consideration boundary conditions were checked.

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.

This testing iscarried during the programming state itself.

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:

Data can be lost across an interface, one module can on another;

sub-functions when combinedmay not produce the desired major function:

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.

All modules are combined in thistesting step.

Then the entire program is tested as a whole.

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:

At the culmination of the integration testing, the software is completely


assembled as a package, interfacing errors have been uncovered and
corrected,

and a final series of softwarevalidation testing began.

Here we test if the system functions in a manner that can be


reasonablyexpected by the customer.

The system is tested against the system requirement specification.

Output Testing:

After performing validation testing, the next phase is output testing of


the proposed system,since no system can be useful if it does not produce
the desired output in the specified format.

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:

Oneis on the screen and the other is on the printed form.

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.

User Acceptance Testing (Beta Testing):

User Acceptance Testing (UAT), also known as beta or end-user testing, is


defined as testingthe software by the user or client to determine whether it
can be accepted or not

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)

or someone who has had a software custom built through a softwareservice


provider or the

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.

After performing loads of system, integration andregression testing one would


wonder about the necessity of this testing.

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

knowledge of adepartment that represents the end users

35
Chapter 8
DATA FLOW DIAGRAM

Student

Validate Details
Enter details

Captured image Manages the


Face Recognition
Attention System
Web cam system provides Admin

Enables Generated reports

Level 0(DFD)

36
Sign Up

Student
Student
Registration

Registered Student

Web cam Image


Acquistion

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

Input student details and


Camera captures the user
image

Image stored in system data base

Recognition process start

Camera capture the user image

Check continuously
Doesn’t match
Compared
with database
image

Match

Present to the student Not Found

A file generated with student details

End

38
USE-CASE DIAGRAM:-

login

Add Student

Manage Student

Search Student

Take Image

Mark Attendance

Admin View Record

Log Out

39
BLOCK DIAGRAM

Admin Student Add Student

Manage Student
Attendance Take Image

Search Student
Mark Attendance

Camera

Camera

Face Recognition

Save Image To Image Attendance

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)

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")

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*

from PIL import ImageTk,Image

55
fromtkinter import ttk

fromtkinter import

filedialog

importmysql.connector

import cv2

fromtkinter import messagebox

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=Label(t, text="Face Recognition


System",fg="#d77337",font="Goudy 26
bold")

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

t1=""" A face recognition system is a technology capable of


matching a

human face from a digital image or a video frame against a


database of

faces, typically employed to authenticate users through ID


verification

services, works by pinpointing and measuring face features from a

givenimage.While initially a form of computer application, face

recognition systems have seen wider uses in recent times on


smartphones

and in other forms of technology, such as robotics. Because


computerized

face recognition involves the measurement of a human's


physiological

characteristics face recognition systems are categorised as


biometrics.

59
Although the accuracy of face recognition systems as a
biometric

technology is lower than iris recognition and fingerprint


recognition,

it is widely adopted due to its contactless process.Face recognition

systems have been deployed in advanced human-computer


interaction,

video surveillance and automatic indexing of images. """

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=Label(t3,text="Attendance Record:-", font="Goudy 16


bold")

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")

conn.execute("select * from att where name="+"'"+d1+"'"+"and


61
reg="+"'"+d2+"'"+"")

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=Label(t3,text="Name : ",bg="light gray",


font="Goudy 15 bold", fg="black")

display2.place(relx=0.35,rely=0.25)

display3=Label(t3,text=d1, font="Goudy 15 bold", bg="light


gray",fg="black")

display3.place(relx=0.44,rely=0.25)

display4=Label(t3,text="Reg : ", font="Goudy 15 bold",


bg="light gray",fg="black")

display5=Label(t3,text=d2, font="Goudy 15 bold", bg="light


gray",fg="black")

display4.place(relx=0.35,rely=0.3)

display5.place(relx=0.44,rely=0.3)

display6=Label(t3,text="Date : ", font="Goudy 15 bold",


bg="light gray",fg="black")

display7=Label(t3,text=d9, font="Goudy 15 bold", bg="light


gray",fg="black")

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:

frame=cv2.putText(frame,"Not matched with database. ",


(50,50),cv2.FONT_HERSHEY_SIMPLEX,1,(250,0,0),2,cv2.LINE_AA)

66
cv2.imshow('video2',frame)

if cv2.waitKey(1)&0xff==ord('q'):

break

print(list1)

cap.release()

cv2.destroyAllWindows()

#saving data in att.

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")

conn.execute("insert into att


values("+"'"+d1+"'"+","+"'"+d2+"'"+","+"'"+cd+"'"+")")

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=Label(t1,text="Your details:-", font="Goudy 16 bold")

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")

conn.execute("select * from student where


name="+"'"+p1+"'"+"and reg="+"'"+p2+"'"+"")

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]

disp2=Label(t1,text="Name : ",bg="light gray",


font="Goudy 15 bold",

fg="black")

disp2.place(relx=0.35,rely=0.25)

disp3=Label(t1,text=d1, font="Goudy 15 bold", bg="light


gray",fg="black")
69
disp3.place(relx=0.44,rely=0.25)

disp4=Label(t1,text="Reg : ", font="Goudy 15 bold",


bg="light gray",fg="black")

disp5=Label(t1,text=d2, font="Goudy 15 bold", bg="light


gray",fg="black")

disp4.place(relx=0.35,rely=0.3)

disp5.place(relx=0.44,rely=0.3)

disp6=Label(t1,text="Contact : ", font="Goudy 15 bold",


bg="light gray",fg="black")

disp7=Label(t1,text=d3, font="Goudy 15 bold", bg="light


gray",fg="black")

disp6.place(relx=0.35,rely=0.35)

disp7.place(relx=0.44,rely=0.35)

disp8=Label(t1,text="Email : ", font="Goudy 15 bold",


bg="light gray",fg="black")

disp9=Label(t1,text=d4, font="Goudy 15 bold", bg="light


gray",fg="black")

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")

disp11=Label(t1,text=d5, 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=Label(t1,text="Course : ", font="Goudy 15 bold",


bg="light gray",fg="black")

disp13=Label(t1,text=d6, font="Goudy 15 bold", bg="light


gray",fg="black")

disp12.place(relx=0.35,rely=0.5)

disp13.place(relx=0.44,rely=0.5)

disp14=Label(t1,text="Gender: ", font="Goudy 15 bold",


bg="light gray",fg="black")

disp15=Label(t1,text=d7, font="Goudy 15 bold", bg="light


gray",fg="black")

disp14.place(relx=0.35,rely=0.55)

disp15.place(relx=0.44,rely=0.55)

disp16=Label(t1,text="Session: ", font="Goudy 15 bold",


bg="light gray",fg="black")

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=Label(t1,text="Please click below to start face


recoginition.",font="10",fg="red",bg="light blue")

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")

conn.execute("select * from student where


name="+"'"+p1+"'"+"and reg="+"'"+p2+"'"+"")

res=conn.fetchall()

count=0

for y in res:
73
count=count+1

if count==0:

print("Invalid Login")

messagebox.showerror("DialogBox", "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=Label(t1, text="-- Student Login --",font="none 20")

head.place(relx=0.43,rely=0.18)

l11=Label(t1,text="Name : ", font="bold", bg="light


gray",fg="blue")

t12=Entry(t1,font="bold", bg="dark gray",bd=4)

l11.pack()

t12.pack()

l11.place(relx=0.33,rely=0.3)

t12.place(relx=0.43,rely=0.3)

l12=Label(t1,text="Reg No: : ", font="bold", bg="light


gray",fg="blue")

t13=Entry(t1,font="bold", bg="dark gray",bd=4)

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()

messagebox.showerror("DialogBox", "You are registered!!!!")

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=Label(t2, text="-- Student Registration Form --",font="none


20")

L.place(relx=0.3,rely=0.1)

lb1=Label(t2,text="Name : ", font="bold", bg="light


gray",fg="blue")

ta1=Entry(t2,font="bold", bg="dark gray",bd=3)

lb1.place(relx=0.3,rely=0.2)

ta1.place(relx=0.43,rely=0.2)

lb6=Label(t2,text="Reg no. : ", font="bold", bg="light


gray",fg="blue")

ta6=Entry(t2,font="bold", bg="dark gray",bd=3)

lb6.place(relx=0.3,rely=0.25)

ta6.place(relx=0.43,rely=0.25)

lb2=Label(t2,text="Contact : ", font="bold", bg="light


gray",fg="blue")

ta2=Entry(t2,font="bold", bg="dark gray",bd=3)


80
lb2.place(relx=0.3,rely=0.3)

ta2.place(relx=0.43,rely=0.3)

lb3=Label(t2,text="Email Id : ", font="bold",bg="light gray",


fg="blue")

ta3=Entry(t2,font="bold", bg="dark gray",bd=3)

lb3.place(relx=0.3,rely=0.35)

ta3.place(relx=0.43,rely=0.35)

lb4=Label(t2,text="Dob : ", font="bold", bg="light


gray",fg="blue")

ta4=Entry(t2,font="bold", bg="dark gray",bd=3)

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",)

ta7=Entry(t2,font="bold", bg="dark gray",bd=3)

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=Button(t2,text="Upload photo",font="bold", bg="dark


gray",command=uploadfile)

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=Button(t2,text="Submit",font="bold", bg="dark gray",


borderwidth=3,command=save)

b2.place(relx=0.5,rely=0.65)

b2.config(width=12,height=1)

#Main-Log in button

b1=Button(t,text="Login",font="Goudy 15 bold", bg="white",


borderwidth=3,command=login)

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.

Therefore, the facial recognition feature embedded in the attendance


monitoring system can not only ensure attendance to be taken accurately and
also eliminated the flaws in the previous system.

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

 The Future enhancements of this project include the following:

Absentee to get Email

Camera Access by mobile Camera rather Web cam.

Get an ID card with name, class, ID, Barcode and Photo on it.

Student can access his/her attendance dates individually to his Email


account

More Authority to the Admin like, add or remove Faculty, update


student details etc.

More information can be stored of students like EmailID, Address,


PhoneNo etc.

Semester and Class wise access to Faculty

More than one Faculty can Access the Application.

91
FUTURE SCOPE

It can be easily implemented at any institute or organization.

A method could be proposed to illustrate robustness against the variations


that is,

in near futurewe could build a system which would be robust and would work
in undesirable conditions too.

Here it is proposed for an institute to take the attendance of the students


but in future it

canbeused to do the same work at entry as well as exit points.

I am working to improve the face recognition effectiveness to build more


efficient systems innearfuture.In further work,

authors intend to improve face recognition effectiveness by using


theinteraction among our system, the users and the administrators.

On the other hand, our systemcan be used in a completely new dimension of


face recognition application, mobile based facerecognition,

which can be an aid for common people to know about any person being
photographed by

cell phone camera including proper authorization for accessing a


centralizeddatabase.

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

You might also like