Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
118 views34 pages

MSBTE Diploma Project Report Viraj and Tanmay

VBGB GHNYJNN HGH

Uploaded by

pratiksingh6005
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)
118 views34 pages

MSBTE Diploma Project Report Viraj and Tanmay

VBGB GHNYJNN HGH

Uploaded by

pratiksingh6005
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/ 34

A PROJECT REPORT ON

“ FACE RECOGNITION ATTENDANCE SYSTEM”


SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD
OF

DIPLOMA IN
COMPUTER ENGINEERING

SUBMITTED TO

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION, MUMBAI


SUBMITTED BY

Name of Student Enrollment No.


Viraj Raju Bhoir 2215480045
Tanmay Vijay Gharat 2215480044 GUIDED BY
Jenishkumar . K . Soni

Katgara Polytechnic Institute


2024-25
Chapter Name Month &
Year

Katgara Polytechnic Institute

CERTIFICATE
This is to Certify that the project report entitled “ FACE RECOGNITION ATTENDANCE
SYSTEM” Was successfully completed by Student of sixth semester Diploma in ( Computer
Engineering ) .

Viraj Raju Bhoir 2215480045


Tanmay Vijay Gharat 2215480044
In partial fulfillment of the requirements for the award of the Diploma in Computer
Engineering and submitted to the Department of Computer of Katgara Polytechnic
Institute work carried out during a period for the academic year 2024-25 as per curriculum

Jenishkumar . K . Soni ISHAN . WAGASKAR

Guide HOD

External Examiner Principal

ACKNOWLEDGEMENT

1
I would like to express my special thanks of gratitude to my project guide
Jenishkumar . K . Soni as well as our principal Dr. Ganesh Mali who gave me
the golden opportunity to do this wonderful project on the topic FACE
RECOGNITION ATTENDANCE SYSTEM, which also helped me in doing a lot of
research and i came to know about so many new things I am really thankful to
them.
Secondly I would also like to thank my parents and friends who helped me a
lot in finalizing this project within the limited time frame.

TABLE OF CONTENTS

CONTENTS PAGE
NO.
1 ABSTRACT 4

2 INTRODUCTION 5

3 LITERATURE SURVEY 6

4 SCOPE OF PROJECT 7

5 METHODOLOGY 8

6 DETAILS OF DESIGN, WORKING AND PROCESSES 10

2
Chapter Name Month &
Year

7 SOURCE CODE 14

8 OUTPUT 28

9 RESULTS AND APPLICATIONS 30

10 CONCLUSION AND FUTURE SCOPE 31

# APPENDIX 33

# REFERENCES 34

1. ABSTRACT

A Face Recognition Attendance System automates the process of recording attendance by


leveraging facial recognition technology to identify individuals accurately and efficiently.
Traditional attendance methods, such as manual roll calls or signature-based systems, are
timeconsuming and prone to errors. Integrating facial recognition addresses these challenges by
providing a swift and reliable alternative.

System Overview:

Enrollment Phase: Individuals (e.g., students or employees) are enrolled into the system by
capturing multiple facial images under varying conditions. These images are stored in a database
alongside unique identifiers such as names and identification numbers.

Attendance Recording: During attendance sessions, real-time images are captured and
processed. The system employs face detection algorithms, such as Haar Cascade Classifiers, to
identify and locate facial features within the captured images. Subsequently, face recognition
algorithms, like Local Binary Patterns Histogram (LBPH), analyze the facial features and

3
compare them against the stored database to find matches. A match leads to automatic marking
of attendance, recording details like the individual's name, ID, date, and time.

Advantages:

Efficiency: Automates the attendance process, reducing the time required compared to manual
methods.

Accuracy: Minimizes errors associated with manual entry and prevents proxy attendance.

Convenience: Simplifies attendance tracking for administrators and provides accessible records
for review.

By implementing a Face Recognition Attendance System, institutions and organizations can


modernize their attendance tracking, enhancing operational efficiency and security..

2. INTRODUCTION

The Face Recognition Attendance System is a Python-based application designed to automate


attendance tracking using facial recognition technology. This system utilizes the OpenCV and
face_recognition libraries to capture and process images, detect faces, and identify individuals.

Key Features:
1. Face Detection: Detects faces in images captured by a camera.
2. Face Recognition: Identifies detected faces using facial recognition algorithms.
3. Attendance Marking: Marks attendance for recognized individuals in a database.
4. Real-time Reporting: Provides real-time attendance reports.

System Requirements:
1. Python: Version 3.6 or higher.
2. OpenCV: Version 4.0 or higher.
3. face_recognition: Version 1.3 or higher.
4. Camera: A webcam or external camera.

Benefits: 1. Increased Accuracy: Reduces errors in


attendance tracking.
2. Improved Efficiency: Automates attendance tracking, reducing manual effort.
3. Enhanced Security: Prevents proxy attendance and ensures secure attendance tracking.

4
Chapter Name Month &
Year

Implementation:
The Face Recognition Attendance System can be implemented in various settings, including:

1. Educational Institutions: To track student attendance.


2. Offices: To track employee attendance.
3. Events: To track attendee presence.

3. LITERATURE SURVEY

Introduction:
Face recognition attendance systems have gained popularity in recent years due to their accuracy
and efficiency. Python, with its extensive libraries and tools, has become a preferred choice for
developing such systems. This literature survey aims to provide an overview of existing face
recognition attendance systems using Python.

Background:
Face recognition technology uses algorithms to identify and verify individuals based on their
facial features. The process involves face detection, feature extraction, and matching. Python
libraries such as OpenCV, face_recognition, and deep learning frameworks like TensorFlow and
Keras have made it easier to develop face recognition systems.

Existing Systems:
1. Face Recognition Attendance System using OpenCV and Python: This system uses
OpenCV for face detection and recognition. It captures images, detects faces, and recognizes
individuals using the Eigenfaces algorithm.
2. Deep Learning-based Face Recognition Attendance System: This system utilizes a
convolutional neural network (CNN) to recognize faces. It uses the Keras deep learning
framework and achieves high accuracy.
3. Face Recognition Attendance System using face_recognition Library: This system uses
the face_recognition library to recognize faces. It captures images, detects faces, and
recognizes individuals using the HOG+SVM algorithm.

5
Challenges and Limitations:
1. Variability in Lighting Conditions: Face recognition systems can be affected by changes in
lighting conditions.
2. Pose and Orientation: Faces can be difficult to recognize when they are not in a frontal
pose or are oriented at an angle.
3. Facial Expressions and Occlusions: Facial expressions and occlusions can affect the
accuracy of face recognition systems.

Future Directions:
1. Improving Robustness to Variability: Developing systems that can handle variations in lighting
conditions, pose, and orientation.
2. Increasing Accuracy: Exploring new algorithms and techniques to improve the accuracy of
face recognition systems.
3. Real-time Processing: Developing systems that can process faces in real-time.

4. SCOPE OF PROJECT

The scope of this project includes:

1. Face Detection: Detecting faces in images captured by a camera.


2. Face Recognition: Recognizing detected faces using facial recognition algorithms.
3. Attendance Marking: Marking attendance for recognized individuals in a database.
4. User Interface: Developing a user-friendly interface for administrators to manage
attendance records.
5. Data Storage: Storing attendance records in a database for future reference.

Functional Requirements:
1. Face Detection Algorithm: Implementing a face detection algorithm to detect faces in
images.
2. Face Recognition Algorithm: Implementing a face recognition algorithm to recognize
detected faces.
3. Attendance Marking System: Developing a system to mark attendance for recognized
individuals.
4. User Authentication: Implementing user authentication to ensure only authorized
personnel can access the system.
5. Data Backup: Implementing a data backup system to prevent loss of attendance
records.

Non-Functional Requirements:
1. Performance: Ensuring the system can detect and recognize faces in real-time.
2. Accuracy: Ensuring the system can accurately recognize faces and mark attendance.
3. Security: Ensuring the system is secure and protects sensitive data.

6
Chapter Name Month &
Year
4. Usability: Ensuring the system is user-friendly and easy to navigate.

Deliverables:
1. Face Recognition Attendance System: A fully functional face recognition attendance
system.
2. User Manual: A user manual outlining the system's features and usage.
3. Technical Documentation: Technical documentation outlining the system's architecture
and implementation.
4. Testing and Quality Assurance: Testing and quality assurance to ensure the system
meets the required standards.

5. METHODOLOGY

Methodological Approach for Face Recognition Attendance System:-

Phase 1: Requirements Gathering and Analysis:-


1. Define Project Scope: Define the scope of the project, including the features and
functionalities of the Face Recognition Attendance System.
2. Identify Requirements: Identify the hardware and software requirements for the system,
including the camera, computer, and Python libraries.
3. Analyze Requirements: Analyze the requirements to ensure that they are complete,
consistent, and unambiguous.

Phase 2: System Design:-


1. System Architecture: Design the system architecture, including the components and
their interactions.
2. Face Detection and Recognition: Design the face detection and recognition algorithms
using Python libraries such as OpenCV and face_recognition. 3. Database Design: Design
the database to store attendance records.

Phase 3: System Development:-


1. Face Detection and Recognition: Develop the face detection and recognition algorithms
using Python libraries such as OpenCV and face_recognition.
2. Attendance Marking: Develop the attendance marking system to mark attendance for
recognized individuals.
3. Database Integration: Integrate the database to store attendance records.

7
Phase 4: Testing and Quality Assurance:-
1. Unit Testing: Perform unit testing to ensure that each component of the system is working
correctly.
2. Integration Testing: Perform integration testing to ensure that the components of the
system are working together correctly.
3. System Testing: Perform system testing to ensure that the system is working correctly.

Phase 5: Deployment and Maintenance:-


1. Deployment: Deploy the system in the production environment.
2. Maintenance: Perform regular maintenance to ensure that the system is working correctly
and efficiently.

Tools and Technologies:


1. Python: Python will be used as the programming language.
2. OpenCV: OpenCV will be used for face detection and recognition.
3. Face_recognition: will be used for face recognition.
4. Database: A database will be used to store attendance records.

8
Chapter Name Month &
Year

6. DETAILS OF DESIGN, WORKING AND PROCESSES

1. Face Recognition Attendance System

Key Components:
1. Face Detection Module: Uses OpenCV to detect faces in images.

2. Face Recognition Module: Utilizes face_recognition to recognize detected faces.

3. Attendance Marking Module: Marks attendance for recognized individuals and stores
records.

4. Database: Manages attendance records and individual information.

5. User Interface: Provides GUI or CLI for administrators to manage attendance records.

6. Camera: Captures images of individuals using USB or IP cameras.

7. Python Libraries: Employs OpenCV, face_recognition, numpy, and pandas for


development.

8. System Requirements: Requires Python, compatible OS, sufficient RAM, and storage.

Design Process:

Step 1: Requirements Gathering

9
- Define project scope and objectives

- Identify functional and non-functional requirements

- Determine system constraints and limitations

Step 2: System Design

- Design system architecture and components

- Select Python libraries (OpenCV, face_recognition, etc.)

- Plan database schema and storage

Step 3: Face Detection and Recognition

- Implement face detection using OpenCV

- Implement face recognition using face_recognition

- Integrate face detection and recognition modules

Step 4: Attendance Marking and Database Integration

- Develop attendance marking module

- Integrate attendance marking with database

- Ensure data storage and retrieval efficiency

Step 5: User Interface Design

- Design user-friendly GUI or CLI

10
Chapter Name Month &
Year
- Implement user authentication and authorization

- Ensure intuitive navigation and functionality

Step 6: Testing and Debugging

- Conduct unit testing and integration testing

- Debug and resolve errors and issues

Working of Face Recognition Attendance System:-

Step 1: Face Detection:-

1. Capture Image: Capture an image of the individual using a camera.

2. Preprocess Image: Preprocess the image to enhance quality.

3. Detect Face: Use OpenCV's Haar Cascade Classifier to detect faces in the image.

Step 2: Face Recognition:-

1. Extract Face Features: Extract face features from the detected face using
face_recognition.

2. Compare with Database: Compare the extracted face features with the faces stored in
the database.

3. Recognize Face: Recognize the face if a match is found in the database.

Step 3: Attendance Marking:-

1. Mark Attendance: Mark attendance for the recognized individual.

2. Store Attendance Record: Store the attendance record in the database.

11
Step 4: Data Storage and Retrieval:-

1. Store Face Encodings: Store face encodings of individuals in the database.

2. Retrieve Attendance Records: Retrieve attendance records for individuals from the
database.

3. Processes Face Recognition Attendance System:-

Process 1: Face Detection:-


1. Capture Image: Capture an image of the individual using a camera.
2. Preprocess Image: Preprocess the image to enhance quality.
3. Detect Face: Use OpenCV's Haar Cascade Classifier to detect faces in the image.

Process 2: Face Recognition:-


1. Extract Face Features: Extract face features from the detected face using
face_recognition.
2. Compare with Database: Compare the extracted face features with the faces
stored in the database.
3. Recognize Face: Recognize the face if a match is found in the database.

Process 3: Attendance Marking:-


1. Mark Attendance: Mark attendance for the recognized individual.
2. Store Attendance Record: Store the attendance record in the database.

Process 4: Data Storage and Retrieval:-


1. Store Face Encodings: Store face encodings of individuals in the database.
2. Retrieve Attendance Records: Retrieve attendance records for individuals from the
database.

Process 5: System Maintenance:-


1. Update Database: Update the database with new face encodings and attendance
records.
2. Troubleshoot Issues: Troubleshoot issues with the system and resolve errors.

Process 6: User Authentication:-


1. Verify User Identity: Verify the user's identity using face recognition.
2. Grant Access: Grant access to the system if the user's identity is verified.

Process 7: Attendance Reporting:-

12
Chapter Name Month &
Year
1. Generate Attendance Reports: Generate attendance reports for individuals and
classes. 2. Send Reports: Send attendance reports to administrators and
parents.

7. SOURCE CODE Python Code:-

#attendance.py import tkinter


as tk from tkinter import *
import os, cv2 import shutil
import csv import numpy as np
from PIL import ImageTk, Image
import pandas as pd import
datetime import time import
tkinter.font as font
import pyttsx3

# project module import


show_attendance import
takeImage import
trainImage import
automaticAttedance

# engine = pyttsx3.init()
# engine.say("Welcome!")
# engine.say("Please browse through your options..")
# engine.runAndWait()

def text_to_speech(user_text):
engine = pyttsx3.init()
engine.say(user_text)
engine.runAndWait()

haarcasecade_path = "haarcascade_frontalface_default.xml" trainimagelabel_path


=(
"./TrainingImageLabel/Trainner.yml"
)

13
trainimage_path = "/TrainingImage"
if not
os.path.exists(trainimage_path):
os.makedirs(trainimage_path)

studentdetail_path = (
"./StudentDetails/studentdetails.csv"
)
attendance_path = "Attendance"

window = Tk() window.title("Face Recognizer")


window.geometry("1280x720") dialog_title = "QUIT"
dialog_text = "Are you sure want to close?"
window.configure(background="#1c1c1c") # Dark theme

# to destroy screen
def del_sc1():
sc1.destroy()

# error message for name and no def


err_screen(): global sc1 sc1 =
tk.Tk() sc1.geometry("400x110")
sc1.iconbitmap("AMS.ico")
sc1.title("Warning!!")
sc1.configure(background="#1c1c1c")
sc1.resizable(0, 0)
tk.Label( sc1,
text="Enrollment & Name required!!!",
fg="yellow",
bg="#1c1c1c", # Dark background for the error window
font=("Verdana", 16, "bold"),
).pack()
tk.Button(
sc1,
text="OK",
command=del_sc1,
fg="yellow",
bg="#333333", # Darker button color
width=9, height=1,
activebackground="red",
font=("Verdana", 16, "bold"),
).place(x=110, y=50)

14
Chapter Name Month &
Year
def testVal(inStr, acttyp):
if acttyp == "1": # insert
if not inStr.isdigit():
return False return True

logo = Image.open("UI_Image/0001.png") logo


= logo.resize((50, 47), Image.LANCZOS)
logo1 = ImageTk.PhotoImage(logo)
titl = tk.Label(window, bg="#1c1c1c", relief=RIDGE, bd=10, font=("Verdana", 30, "bold"))
titl.pack(fill=X)
l1 = tk.Label(window, image=logo1, bg="#1c1c1c",) l1.place(x=470,
y=10)

titl = tk.Label(
window, text="CLASS VISION", bg="#1c1c1c", fg="yellow", font=("Verdana", 27, "bold"),
)
titl.place(x=525, y=12)

a=
tk.Label( window,
text="Welcome to CLASS VISION",
bg="#1c1c1c", # Dark background for the main
text fg="yellow", # Bright yellow text color
bd=10,
font=("Verdana", 35, "bold"),
)
a.pack()

ri = Image.open("UI_Image/register.png")
r = ImageTk.PhotoImage(ri) label1 =
Label(window, image=r)
label1.image = r
label1.place(x=100, y=270)

ai =
Image.open("UI_Image/attendance.png") a =
ImageTk.PhotoImage(ai) label2 =
Label(window, image=a)
label2.image = a
label2.place(x=980, y=270)

15
vi = Image.open("UI_Image/verifyy.png")
v = ImageTk.PhotoImage(vi) label3 =
Label(window, image=v)
label3.image = v
label3.place(x=600, y=270)
def TakeImageUI():
ImageUI = Tk()
ImageUI.title("Take Student Image..")
ImageUI.geometry("780x480")
ImageUI.configure(background="#1c1c1c") # Dark background for the image window
ImageUI.resizable(0, 0)
titl = tk.Label(ImageUI, bg="#1c1c1c", relief=RIDGE, bd=10, font=("Verdana", 30, "bold"))
titl.pack(fill=X) # image and title titl = tk.Label(
ImageUI, text="Register Your Face", bg="#1c1c1c", fg="green", font=("Verdana", 30,
"bold"),
)
titl.place(x=270, y=12)

# heading
a = tk.Label(
ImageUI,
text="Enter the details",
bg="#1c1c1c", # Dark background for the details label
fg="yellow", # Bright yellow text color bd=10,
font=("Verdana", 24, "bold"),
)
a.place(x=280, y=75)

# ER no lbl1 =
tk.Label( ImageUI,
text="Enrollment No",
width=10,
height=2,
bg="#1c1c1c",
fg="yellow", bd=5,
relief=RIDGE,
font=("Verdana", 14),
)
lbl1.place(x=120, y=130)
txt1 = tk.Entry(
ImageUI,
width=17, bd=5,
validate="key",
bg="#333333", #
Dark input

16
Chapter Name Month &
Year
background
fg="yellow", #
Bright text color for
input
relief=RIDGE,
font=("Verdana", 18, "bold"),
)
txt1.place(x=250, y=130)
txt1["validatecommand"] = (txt1.register(testVal), "%P", "%d")

# name lbl2 =
tk.Label( Imag
eUI,
text="Name",
width=10,
height=2,
bg="#1c1c1c",
fg="yellow",
bd=5,
relief=RIDGE,
font=("Verdana", 14),
)
lbl2.place(x=120, y=200)
txt2 =
tk.Entry( ImageUI,
width=17,
bd=5,
bg="#333333", # Dark input background
fg="yellow", # Bright text color for input
relief=RIDGE,
font=("Verdana", 18, "bold"),
)
txt2.place(x=250, y=200)

lbl3 =
tk.Label( ImageUI,
text="Notification",
width=10,
height=2,
bg="#1c1c1c",
fg="yellow", bd=5,
relief=RIDGE,
font=("Verdana", 14),
)
lbl3.place(x=120, y=270)

17
message = tk.Label(
ImageUI,
text="",
width=32,
height=2, bd=5,
bg="#333333", # Dark background for messages
fg="yellow", # Bright text color for messages
relief=RIDGE, font=("Verdana", 14, "bold"),
)
message.place(x=250, y=270)

def take_image():
l1 = txt1.get()
l2 = txt2.get()
takeImage.TakeImage(
l1,
l2,
haarcasecade_path,
trainimage_path,
message,
err_screen,
text_to_speech,
)
txt1.delete(0, "end")
txt2.delete(0, "end")

# take Image button


# image takeImg =
tk.Button( ImageU
I, text="Take
Image",
command=take_image, bd=10,
font=("Verdana", 18, "bold"), bg="#333333", #
Dark background for the button fg="yellow", #
Bright text color for the button
height=2,
width=12,
relief=RIDGE,
)
takeImg.place(x=130, y=350)

def train_image():
trainImage.TrainImage( haarcasecade

18
Chapter Name Month &
Year
_path, trainimage_path,
trainimagelabel_path, message,
text_to_speech,
)

# train Image function call trainImg = tk.Button(


ImageUI, text="Train Image",
command=train_image, bd=10,
font=("Verdana", 18, "bold"), bg="#333333", #
Dark background for the button fg="yellow", #
Bright text color for the button
height=2,
width=12,
relief=RIDGE,
)
trainImg.place(x=360, y=350)

r = tk.Button( window,
text="Register a new student",
command=TakeImageUI,
bd=10, font=("Verdana", 16),
bg="black", fg="yellow",
height=2, width=17,
)
r.place(x=100, y=520)

def automatic_attedance():
automaticAttedance.subjectChoose(text_to_speech)

r = tk.Button( window,
text="Take Attendance",
command=automatic_attedance,
bd=10,
font=("Verdana", 16),
bg="black",
fg="yellow", height=2,
width=17,
)
r.place(x=600, y=520)

def view_attendance():

19
show_attendance.subjectchoose(text_to_speech)

r = tk.Button( window,
text="View Attendance",
command=view_attendance,
bd=10, font=("Verdana",
16), bg="black",
fg="yellow", height=2,
width=17,
)
r.place(x=1000, y=520)
r =
tk.Button( window,
text="EXIT", bd=10,
command=quit,
font=("Verdana", 16),
bg="black",
fg="yellow",
height=2,
width=17,
)
r.place(x=600, y=660)

window.mainloop()

# automiticAttendance.py

import tkinter as tk
from tkinter import *
import os, cv2
import shutil import csv import
numpy as np from PIL import
ImageTk, Image import pandas
as pd import datetime import
time import tkinter.ttk as tkk
import tkinter.font as font

haarcasecade_path = "haarcascade_frontalface_default.xml"
trainimagelabel_path = ( "TrainingImageLabel\\
Trainner.yml"
)

20
Chapter Name Month &
Year
trainimage_path = "TrainingImage" studentdetail_path
=(
"StudentDetails\\studentdetails.csv"
)
attendance_path = "Attendance" # for
choose subject and fill attendance def
subjectChoose(text_to_speech): def
FillAttendance(): sub = tx.get()
now = time.time() future = now + 20
print(now) print(future) if sub ==
"": t = "Please enter the subject
name!!!" text_to_speech(t) else:
try:
recognizer = cv2.face.LBPHFaceRecognizer_create()
try:
recognizer.read(trainimagelabel_path)
except:
e = "Model not found,please train model"
Notifica.configure(
text=e, bg="black",
fg="yellow",
width=33,
font=("times", 15, "bold"),
)
Notifica.place(x=20, y=250)
text_to_speech(e) facecasCade =
cv2.CascadeClassifier(haarcasecade_path)
df = pd.read_csv(studentdetail_path)
cam = cv2.VideoCapture(0) font =
cv2.FONT_HERSHEY_SIMPLEX col_names =
["Enrollment", "Name"] attendance =
pd.DataFrame(columns=col_names) while True:
___, im = cam.read()
gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
faces = facecasCade.detectMultiScale(gray, 1.2, 5)
for (x, y, w, h) in faces: global Id

Id, conf = recognizer.predict(gray[y : y + h, x : x + w])


if conf < 70: print(conf) global
Subject global aa global date
global timeStamp Subject = tx.get()
ts = time.time()
date = datetime.datetime.fromtimestamp(ts).strftime(
"%Y-%m-%d"
)

21
timeStamp = datetime.datetime.fromtimestamp(ts).strftime(
"%H:%M:%S"
)
aa = df.loc[df["Enrollment"] == Id]["Name"].values
global tt
tt = str(Id) + "-" + aa
# En='1604501160'+str(Id)
attendance.loc[len(attendance)] = [
Id,
aa,
]
cv2.rectangle(im, (x, y), (x + w, y + h), (0, 260, 0), 4)
cv2.putText(
im, str(tt), (x + h, y), font, 1, (255, 255, 0,), 4
)
else:
Id = "Unknown"
tt = str(Id)
cv2.rectangle(im, (x, y), (x + w, y + h), (0, 25, 255), 7)
cv2.putText(
im, str(tt), (x + h, y), font, 1, (0, 25, 255), 4
) if
time.time() > future:
break

attendance = attendance.drop_duplicates(
["Enrollment"], keep="first"
)
cv2.imshow("Filling Attendance...", im)
key = cv2.waitKey(30) & 0xFF if key
== 27:
break

ts = time.time()
print(aa)
# attendance["date"] = date
# attendance["Attendance"] = "P"
attendance[date] = 1
date = datetime.datetime.fromtimestamp(ts).strftime("%Y-%m-%d")
timeStamp = datetime.datetime.fromtimestamp(ts).strftime("%H:%M:%S")
Hour, Minute, Second = timeStamp.split(":")
# fileName = "Attendance/" + Subject + ".csv"
path = os.path.join(attendance_path, Subject)
if not os.path.exists(path):

22
Chapter Name Month &
Year
os.makedirs(path)
fileName =
( f"{path}/"
+ Subject
+ "_"
+ date
+ "_"
+ Hour
+ "-"
+ Minute
+ "-"
+ Second
+ ".csv"
)
attendance = attendance.drop_duplicates(["Enrollment"], keep="first")
print(attendance)
attendance.to_csv(fileName, index=False)

m = "Attendance Filled Successfully of " + Subject


Notifica.configure(
text=m,
bg="black",
fg="yellow",
width=33,
relief=RIDGE,
bd=5,
font=("times", 15, "bold"),
)
text_to_speech(m)

Notifica.place(x=20, y=250)

cam.release()
cv2.destroyAllWindows()

import csv
import tkinter

root = tkinter.Tk()
root.title("Attendance of " + Subject)
root.configure(background="black")
cs = os.path.join(path, fileName)
print(cs) with open(cs, newline="")
as file:

23
reader = csv.reader(file)
r=0
for col in
reader:
c=0
for row in col:

label = tkinter.Label(
root,
width=10, height=1,
fg="yellow", font=("times",
15, " bold "), bg="black",
text=row,
relief=tkinter.RIDGE,
)
label.grid(row=r, column=c)
c += 1
r += 1
root.mainloop()
print(attendance) except:
f = "No Face found for attendance"
text_to_speech(f) cv2.destroyAllWindows()

###windo is frame for subject chooser


subject = Tk()
# windo.iconbitmap("AMS.ico")
subject.title("Subject...")
subject.geometry("580x320")
subject.resizable(0, 0)
subject.configure(background="black")
# subject_logo = Image.open("UI_Image/0004.png")
# subject_logo = subject_logo.resize((50, 47), Image.ANTIALIAS)
# subject_logo1 = ImageTk.PhotoImage(subject_logo)
titl = tk.Label(subject, bg="black", relief=RIDGE, bd=10, font=("arial", 30))
titl.pack(fill=X)
# l1 = tk.Label(subject, image=subject_logo1, bg="black",)
# l1.place(x=100, y=10)
titl = tk.Label(
subject,
text="Enter the Subject Name",
bg="black",
fg="green",
font=("arial", 25),
)

24
Chapter Name Month &
Year
titl.place(x=160, y=12)
Notifica = tk.Label(
subject,
text="Attendance filled Successfully",
bg="yellow", fg="black",
width=33, height=2,
font=("times", 15, "bold"),
)
def Attf():
sub = tx.get() if sub == "":
t = "Please enter the subject name!!!"
text_to_speech(t) else:
os.startfile(
f"Attendance\\{sub}"
)
attf =
tk.Button( subject,
text="Check Sheets",
command=Attf,
bd=7, font=("times
new roman", 15),
bg="black",
fg="yellow",
height=2, width=10,
relief=RIDGE,
)
attf.place(x=360, y=170)

sub =
tk.Label( subject,
text="Enter Subject",
width=10, height=2,
bg="black",
fg="yellow", bd=5,
relief=RIDGE,
font=("times new roman", 15),
)
sub.place(x=50, y=100)
tx =
tk.Entry( subject,
width=15, bd=5,
bg="black",
fg="yellow",
relief=RIDGE,
font=("times", 30, "bold"),

25
)
tx.place(x=190, y=100)
fill_a =
tk.Button( subject,
text="Fill Attendance",
command=FillAttendance,
bd=7, font=("times new
roman", 15), bg="black",
fg="yellow", height=2,
width=12, relief=RIDGE,
)
fill_a.place(x=195, y=170)
subject.mainloop()
8. OUTPUT

26
Chapter Name Month &
Year

27
28
Chapter Name Month &
Year
9. RESULTS AND APPLICATIONS

Results:

1. Improved Attendance Accuracy: The system ensures accurate attendance marking,


reducing errors and discrepancies.

2. Increased Efficiency: Automated attendance marking saves time and effort for
administrators and teachers.

3. Enhanced Security: The system provides a secure and tamper-proof attendance


recording mechanism.

4. Real-time Attendance Tracking: Administrators can track attendance in real-time,


enabling prompt action for absentees.

5. Reduced Administrative Burden: Automated attendance marking reduces the workload


of administrators and teachers.

6. Improved Student/Employee Engagement: Accurate attendance tracking can lead to


improved student/employee engagement and motivation.

Applications:

1. Educational Institutions: Schools, colleges, and universities can use the system to
automate attendance marking.

2. Corporate Offices: Companies can use the system to track employee attendance and
monitor workforce productivity.

3. Government Institutions: Government agencies can use the system to track attendance
of employees and citizens.

4. Event Management: Event organizers can use the system to track attendee attendance
and manage event

29
10.Conclusion and Future

Conclusion on Face Recognition Attendance System:-

The Face Recognition Attendance System using Python is a robust and efficient attendance
tracking mechanism. The system utilizes face recognition technology to identify individuals and
mark their attendance. The system consists of various components, including face detection, face
recognition, attendance marking, and data storage

Key Findings:

1. Accuracy: The system demonstrates high accuracy in face recognition and attendance marking.

2. Efficiency: The system automates attendance marking, reducing administrative tasks and
increasing productivity.

3. Security: The system provides a secure and tamper-proof attendance recording mechanism.

4. Scalability: The system can be easily scaled up or down to accommodate changing attendance
requirements.

Implications:

1. Educational Institutions: The system can be used to track student attendance, reducing
absenteeism and improving academic performance.

2. Corporate Offices: The system can be used to track employee attendance, improving
workforce productivity and reducing absenteeism.

3. Government Institutions: The system can be used to track attendance of employees and
citizens, improving transparency and accountability.

Future Directions:

1. Integration with Other Systems: Integrating the system with other systems, such as student
information systems or HR management systems.

2. Advanced Analytics: Developing advanced analytics to provide insights into attendance


patterns and trends.
3. Mobile App Development: Developing a mobile app to enable remote attendance marking
and tracking.

30
Chapter Name Month &
Year
Recommendations:

1. Implementing the System: Implementing the Face Recognition Attendance System in


various settings to improve attendance tracking and management.

2. Conducting Further Research: Conducting further research to improve the accuracy and
efficiency of the system.
3. Developing Advanced Features: Developing advanced features, such as facial expression
analysis and sentiment analysis, to enhance the system's functionality

Future Scope of Face Recognition Attendance System:-

1. Advanced Analytics:
- Develop advanced analytics to provide insights into attendance patterns and trends.
- Use machine learning algorithms to identify correlations and anomalies.

2. Facial Expression Analysis:


- Integrate facial expression analysis to detect emotions and sentiment.
- Use this data to improve student/employee engagement and well-being.

3. Security Enhancements:
- Implement advanced security measures to prevent data breaches and unauthorized access.
- Use encryption, secure authentication, and access controls.

4. Cloud-Based Deployment:
- Deploy the system on cloud-based platforms for scalability and flexibility. -
Enable easy access and management of attendance data.

5. Continuous Improvement:
- Continuously update and improve the system based on user feedback and technological
advancements.
- Ensure the system remains accurate, efficient, and secure.

31
11.APPENDIX

Appendix for Face Recognition Attendance System :-

A: System Codebase:-
- Detailed listings of the source code used in the system, including face detection.
- Explanation of code modules and functions.
- References to external libraries and dependencies utilized.

B: Installation Guide:-
- Step-by-step instructions for setting up the system environment.
- Installation procedures for required software and libraries. - Configuration settings
and troubleshooting tips.

C: User Manual:-
- Instructions on how to operate the attendance system.
- Guidelines for enrolling new users and managing attendance records.
- Screenshots and user interface walkthroughs.

D: System Evaluation:-
- Performance metrics and accuracy rates of the face recognition system.
- Comparison with traditional attendance methods.
- User feedback and system usability analysis.

E: Alert System Setup:-


- Guidelines for configuring notifications to inform users about attendance status.
- Customization options for alert preferences.
- Troubleshooting common alert system issues.

F: Technologies and Tools Documentation:-


- Overview of the technologies and tools used, such as OpenCV, Haar Cascade.
- Documentation and resources for further reading on these technologies.

32
Chapter Name Month &
Year

12. REFERENCES

References For Face Recognition Attendance System:-

A. Scholarly Articles:

- Research papers that provide insights into face recognition algorithms and their applications in
attendance systems.

- Studies on the effectiveness and challenges of biometric-based attendance systems.

- Comparative analyses of different facial recognition techniques.

B. Books and Manuals:

- Authoritative texts on biometric systems and facial recognition technology.

- User manuals for software and tools integrated into the system.

C. Online Resources:

- Documentation and tutorials from official websites of technologies used (e.g., OpenCV, Python
libraries).

- Community forums and discussion boards for troubleshooting and best practices.

33

You might also like