0% found this document useful (0 votes)
17 views38 pages

Bank Management Report

Uploaded by

talelenehal1726
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)
17 views38 pages

Bank Management Report

Uploaded by

talelenehal1726
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/ 38

I

A Mini Project Report on

AUTOMATED ATTENDANCE SYSTEM


submitted in partial fulfillment of the requirements of the Second Year of Bachelor of
Information Technology Engineering
By:

Yash Mahesh kosumbkar 2301624


Paras Dhaneshwar Dhande 2301611
Nehal Dhanraj Talele 2301644

Guide
Prof. A. D. Palsodkar

Department of Information Technology


Konkan Gyanpeeth College of Engineering
Karjat, Raigad – 410201

University of Mumbai (AY 2024-25)


II

CERTIFICATE

This is to certify that the Mini Project entitled “Automated Attendance


System” is a bonafide work of,

Yash Mahesh Kosumbkar (2301624)


Paras Dhaneshwar Dhande (2301611)
Nehal Dhanraj Talele (2301644)

submitted to the University of Mumbai in partial fulfillment of the


requirement for the award of the degree of “Second Year Of
Engineering”
in “Information Technology”.

( Prof. A. D. Palsodkar ) (Prof. Anup Kunte)

Guide Head of Department


III

Mini Project Approval

This Mini Project entitled “Automated Attendance System” by

Yash Mahesh Kosumbkar (2301624)


Paras Dhaneshwar Dhande (2301611)
Nehal Dhanraj Talele (2301644)

is approved for the degree of Second Year Engineering


in Information Technology.

` Examiners

1.............................................
(Internal Examiner Name & Sign)

2................................................
(External Examiner name & Sign)

Date:

Place:
IV

Declaration

I/We declare that this written submission represents my/our ideas in my/our own words
and where others' ideas or words have been included, I/We have adequately cited and
referenced the original sources. I/We also declare that I/We have adhered to all principles of
academic honesty and integrity and have not misrepresented or fabricated or falsified any
idea/data/fact/source in my/our submission. I/We understand that any violation of the above
will be cause for disciplinary action by the Institute and can also evoke penal action from the
sources which have thus not been properly cited or from whom proper permission has not
been taken when needed

Paras Dhaneshwar Dhande (2301611) -----------------------------

Yash Mahesh Kosumbkar (2301624) -----------------------------

Nehal Dhanraj Talele (2301644) -----------------------------

Date :-
V

CONTENTS
Topic Page No

1 ABSTRACT

2 ACKNOWLEDGEMENT

OVERVIEW OF THE PROJECT


3
 INTRODUCTION

5 SYSTEM DESIGN

6 E-R DIAGRAMS

7 IMPLEMENTATION

8 GUI OF SYSTEM

CONCLUSION & SCOPE FOR


9
FUTURE DEVLOPMENT

10 REFRENCES
1

ABSTRACT
The Automated Attendance System is a Python-based application designed to automate the
process of attendance tracking using face recognition technology. This system is a desktop
application that can be accessed within an organization to streamline attendance management.
The project has been developed with a modular architecture, ensuring centralized storage of
attendance records in an Excel file. The application leverages Python libraries such
as face_recognition, OpenCV, and pandas for real-time face detection, recognition, and data
management.

The system captures live video feed from a webcam, detects faces, and matches them with
pre-registered student images to mark attendance. Attendance records are stored with details
such as the student's name, date, and time, ensuring accuracy and reliability. The system has
been designed to prevent duplicate entries during a session and provides a user-friendly
interface for administrators.

The entire project has been developed with a focus on real-time processing and data
consistency. The system architecture ensures scalability and reliability, with the potential for
future enhancements such as database integration and multi-camera support. High care has
been taken to ensure that the system adheres to proper validation rules and maintains data
integrity. The application provides a robust and efficient solution for automating attendance
processes in educational institutions and organizations.
2

ACKNOWLEDGEMENT
It is with immense satisfaction and a sense of accomplishment that we have
successfully completed our project, Automated Attendance System Using Face
Recognition. We take this opportunity to express our heartfelt gratitude to everyone who
contributed to the successful completion of this work.
We extend our sincere gratitude to Prof. A.S.Kunte, Head of the Department of
INFORMATION TECHNOLOGY , for their invaluable guidance and constant support
throughout the project. Their encouragement and insights have been instrumental in shaping
this project.
We are deeply thankful to our Project Coordinator and Guide , Prof A.D.Palsodkar ,
for their valuable suggestions, continuous support, and expert guidance during every phase of
the project. Their constructive feedback and encouragement have been a source of motivation
for us.We also wish to convey our gratitude to all the members of the Project Panel and
everyone who has directly or indirectly contributed to the successful completion of this
project. Their support and cooperation have been invaluable.Finally, we thank our peers,
friends, and family for their encouragement and assistance,which have been a constant source
of inspiration throughout this journey.

.
3

OVERVIEW OF THE PROJECT


4

INTRODUCTION
The Automated Attendance System is a comprehensive solution designed to
automate the process of attendance tracking using advanced face recognition technology. This
system provides educational institutions and organizations with an efficient and accurate way
to manage attendance records. By leveraging real-time video processing, the system captures
live video from a webcam, detects faces, and matches them with pre-registered student
images to mark attendance.

The system is fast, reliable, and user-friendly, allowing administrators to track


attendance seamlessly. It eliminates the need for manual attendance tracking, reducing errors
and preventing proxy attendance. Attendance records are stored in an Excel file, which can be
accessed and analyzed easily. The system also ensures data consistency by preventing
duplicate entries during a session.

This attendance system is developed using Python programming language and utilizes
libraries such as face_recognition, OpenCV, and pandas for face detection, recognition, and
data management. It is designed as a desktop application, making it accessible and easy to
use. The primary aim of this system is to modernize the attendance process, making it more
efficient and accessible from anywhere. With the use of this software, institutions can save
time, improve accuracy, and enhance the overall attendance management process.
5

SYSTEM DESIGN
6

PURPOSE OF THE SYSTEM :-

i. SECURITY: The Automated Attendance System ensures a high level of data


security. Only authorized users can access the system, as it requires a valid
username and password to operate. This prevents unauthorized access and ensures
the integrity of attendance records

ii. DATA CONSISTENCY: The system maintains data consistency by preventing


duplicate entries during a session. Attendance is recorded only once per session for
each individual, ensuring accurate and reliable records.

iii. EASY RETRIEVAL OF DATA: Attendance data is stored in an Excel file,


making it easy to retrieve and analyze. Administrators can quickly access
attendance records using tools like Microsoft Excel or Python-based data analysis
libraries.

iv. AUTOMATION OF PROCESS: The system automates key processes such as face
detection, recognition, and attendance recording. This reduces manual effort and
ensures that attendance is recorded accurately and efficiently in real-time.

SCOPE OF THE PROPOSED SYSTEM :-

Though there are many attendance systems available online, this system stands out due
to its advanced functionality and real-time face recognition capabilities. It can be
implemented in educational institutions, corporate offices, and other organizations to
automate attendance management effectively. The basic functionalities of the system are:

1. Student Registration Module:


Administrators can register new students by uploading their images to the system. The system
encodes the facial features of the uploaded images and stores them along with the student’s
name for future recognition.

2. Real-Time Attendance Module:


The system uses a webcam to capture live video and detect faces in real-time. It matches the
detected faces with pre-registered student images and automatically records attendance in an
Excel file.

3. Duplicate Detection Module:


The system ensures that attendance is recorded only once per session for each student. If a
student has already been marked present, their attendance will not be recorded again during
the same session.
7

4. Attendance Report Module:


Administrators can access and analyze attendance records stored in an Excel file. The records
include details such as the student’s name, date, and time of attendance.

5. Face Recognition Module:


The system uses advanced face recognition technology to identify students accurately. It
ensures that only registered students are marked present, preventing proxy attendance.

6. Data Security Module:


The system ensures data security by restricting access to authorized users. Only
administrators with valid credentials can access the system and manage attendance records.

7. Live Monitoring Module:


Administrators can monitor the live video feed from the webcam, which displays the names
of recognized students in real-time. This provides a visual confirmation of attendance.

8. Logout Module:
Administrators can securely log out of the system after completing their tasks. This ensures
that unauthorized users cannot access the system.
8

MODULES FOR ADMINISTRATOR :-

1. Attendance Report Module:


Description: The administrator can view the attendance report through the
application by logging into the system. The administrator must enter their username
and password on the login page and click on the "Login" button. Once logged in,
various services will appear on the screen. The administrator must click on the
"Attendance Report" button, and the attendance history, including student names,
dates, and times, will be displayed.

2. Student Registration Module:


Description: The administrator can register new students into the system by
uploading their images. After logging into the system with valid credentials, the
administrator must click on the "Student Registration" button. A new page will
appear where the administrator can upload the student's image and enter their details.
The system will encode the student's face and store it for future recognition.

3. Update Attendance Records Module:


Description: The administrator can update attendance records manually if required.
After logging into the system, the administrator must click on the "Update
Attendance" button. A new page will appear where the administrator can modify or
add attendance entries in the Excel file.

4. Delete Attendance Records Module:


Description: The administrator can delete attendance records if necessary. After
logging into the system, the administrator must click on the "Delete Attendance"
button. A new page will appear where the administrator can select and remove
specific attendance entries from the Excel file.

5. Live Monitoring Module:


Description: The administrator can monitor the live video feed from the webcam to
view real-time face recognition. After logging into the system, the administrator
must click on the "Live Monitoring" button. The system will display the live video
feed with the names of recognized students overlaid on the screen.

6. Logout Module:
Description: The administrator can securely log out of the system after completing
their tasks. By clicking on the "Logout" button, the administrator ensures that
unauthorized users cannot access the system.
9

OBJECTIVE OF BANK MANAGEMENT SYSTEM

 To allow only authorized administrators to access and manage the system.

 Automate the process of attendance tracking using face recognition technology.

 Reduce manual effort and clerical work by automating attendance recording and
management.

 Provide greater speed and efficiency in attendance tracking, reducing time consumption.

 Ensure accurate and reliable attendance records, preventing proxy attendance.

 Maintain a centralized record of attendance data for easy access and analysis.

 Provide a user-friendly interface so that even a beginner can operate the system and manage
attendance effortlessly.

 Enable real-time face recognition and attendance marking, ensuring seamless operation
during sessions.

 The project aims to modernize and automate the attendance process, making it more efficient
and accessible for educational institutions and organizations.
10

Functionalities provided by Automated Attendance System are as follow :

 Provides the ability to recognize and identify students based on their pre-registered facial
data.

 The Automated Attendance System manages attendance records, including student names,
dates, and times, and stores them in an Excel file for easy access and analysis.

 Tracks all the information related to attendance, including the real-time detection of faces and
their recognition.

 Displays the name of the recognized student on the live video feed, providing immediate
feedback to the administrator.

 Ensures data consistency by preventing duplicate attendance entries during the same session.

 Increases the efficiency of managing attendance by automating the process, reducing manual
effort, and saving time.

 Monitors and records attendance in real-time, ensuring accuracy and reliability.

 Manages the information of students, including their facial encodings and associated names,
for future recognition.
11

E – R DIAGRAMS
12

E – R DIAGRAMS:

The relationship within the Automated Attendance System is structured through a


conceptual Entity-Relationship Diagram (ERD), which not only specifies the existential
entities but also the standard relationships through which the system operates and the
cardinalities necessary for the system's functionality to continue.
The Entity-Relationship Diagram (ERD) depicts the relationship between the data
objects in the system. The ERD serves as a visual representation of the data model,
illustrating how data objects interact with one another. The attributes of each data object
noted in the ERD can be described using a data object description.
The set of primary components identified by the ERD are:

 Data Objects:
These represent the key entities in the system, such as Student, Attendance Record,
and Administrator.

 Relationships:
These define how the data objects are connected. For example, a Student is linked to
an Attendance Record through the process of attendance marking.

 Attributes:
These are the properties of each data object. For instance, the Student entity may have
attributes like Name, ID, and Face Encoding, while the Attendance Record entity may
have attributes like Date, Time, and Status.

 Various Types of Indicators:


These include primary keys, foreign keys, and cardinalities that define the constraints and
relationships between entities
The primary purpose of the ERD is to represent data objects and their relationships.
.
13
14
15

IMPLEMENTATION
16

Program : -

1.Registration Process :
import cv2
import os
import pandas as pd
import tkinter as tk
from tkinter import Label, Entry, Button, ttk, messagebox
from tkcalendar import DateEntry
from datetime import datetime
from PIL import Image, ImageTk
import subprocess

# Create folder for storing face images


folder_path = "students_faces"
os.makedirs(folder_path, exist_ok=True)

# Excel file to store student data


excel_file = "students_data.xlsx"
if not os.path.exists(excel_file):
df = pd.DataFrame(columns=["Name", "Gender", "DOB", "Age"])
df.to_excel(excel_file, index=False)

# Load OpenCV face detector


face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades +
"haarcascade_frontalface_default.xml")

# Global Variables
cap = None
student_name = ""
gender = ""
dob = ""
age = 0
count = 0

# Initialize Tkinter
root = tk.Tk()
17

root.title("Student Face Registration")


root.geometry("900x600")

# Load images
try:
bg_image = Image.open("BGM.jpg").resize((900, 600),
Image.LANCZOS)
bg_photo = ImageTk.PhotoImage(bg_image)
except:
bg_photo = None

try:
logo_image = Image.open("logokgce.png").resize((100, 100),
Image.LANCZOS)
logo_photo = ImageTk.PhotoImage(logo_image)
except:
logo_photo = None

# Page 1 - Student Details Entry


page1_frame = tk.Frame(root)
page1_frame.pack(fill="both", expand=True)

# Background
canvas = tk.Canvas(page1_frame, width=900, height=600)
canvas.pack(fill="both", expand=True)
if bg_photo:
canvas.create_image(0, 0, anchor="nw", image=bg_photo)
if logo_photo:
canvas.create_image(10, 10, anchor="nw", image=logo_photo)

# College Info
canvas.create_text(750, 30, text="Headmaster: Dr. VJ Pillewan",
font=("Arial", 12, "bold"), fill="black", anchor="e")
canvas.create_text(750, 50, text="Staff: Prof. Kunte, Mr. A. Palsodkar",
font=("Arial", 12), fill="black", anchor="e")

# Labels & Inputs


canvas.create_text(450, 150, text="Student Registration", font=("Arial",
20, "bold"), fill="black")

name_label = Label(page1_frame, text="Name:", font=("Arial", 14),


bg="white")
18

name_entry = Entry(page1_frame, font=("Arial", 14))

gender_label = Label(page1_frame, text="Gender:", font=("Arial", 14),


bg="white")
gender_var = tk.StringVar()
gender_menu = ttk.Combobox(page1_frame, textvariable=gender_var,
font=("Arial", 14), values=["Male", "Female", "Other"], state="readonly")

dob_label = Label(page1_frame, text="Date of Birth:", font=("Arial", 14),


bg="white")
dob_entry = DateEntry(page1_frame, font=("Arial", 14),
date_pattern="yyyy-MM-dd", width=12)

# Place widgets
canvas.create_window(450, 200, window=name_label)
canvas.create_window(450, 230, window=name_entry)
canvas.create_window(450, 270, window=gender_label)
canvas.create_window(450, 300, window=gender_menu)
canvas.create_window(450, 340, window=dob_label)
canvas.create_window(450, 370, window=dob_entry)

# Function to proceed to face capture


def open_capture_page(event=None): # Add event parameter for Enter key
global student_name, gender, dob, age

student_name = name_entry.get().strip().title()
gender = gender_var.get()
dob = dob_entry.get()

if not student_name or not gender or not dob:


messagebox.showerror("Error", "Please fill all fields!")
return

# Calculate Age
age = datetime.today().year - datetime.strptime(dob, "%Y-%m-
%d").year

# Check for duplicate entries


df = pd.read_excel(excel_file)
if student_name in df["Name"].values:
messagebox.showwarning("Duplicate Entry", "Student already
registered!")
19

Return

# Save details in Excel


new_entry = pd.DataFrame({"Name": [student_name], "Gender":
[gender], "DOB": [dob], "Age": [age]})
df = pd.concat([df, new_entry], ignore_index=True)
df.to_excel(excel_file, index=False)
# Proceed to face capture
show_capture_page()

# Buttons
next_button = Button(page1_frame, text="Next ➜", font=("Arial", 14),
command=open_capture_page, bg="#4CAF50", fg="white", padx=20)
canvas.create_window(450, 420, window=next_button)

# Bind Enter key to proceed to next page


root.bind("<Return>", open_capture_page)

# Page 2 - Face Capture


page2_frame = tk.Frame(root, bg="#f0f8ff")
video_label = Label(page2_frame, bg="#f0f8ff")
video_label.pack()

status_label_capture = Label(page2_frame, text="Capturing Face...",


font=("Arial", 14), fg="blue", bg="#f0f8ff")
status_label_capture.pack(pady=10)

Button(page2_frame, text="⬅ Back", font=("Arial", 14),


command=lambda: return_to_entry_page(), bg="red",
fg="white").pack(pady=10)

# Function to start face capture


def show_capture_page():
global cap, count
count = 0
cap = cv2.VideoCapture(0)
page1_frame.pack_forget()
page2_frame.pack(fill="both", expand=True)
capture_faces()

def capture_faces():
global cap, count
20

if cap is None or not cap.isOpened():


return
ret, frame = cap.read()
if not ret:
return

gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)


faces = face_cascade.detectMultiScale(gray, scaleFactor=1.3,
minNeighbors=5, minSize=(100, 100))

for (x, y, w, h) in faces:


face = frame[y:y+h, x:x+w]
face_path = os.path.join(folder_path, f"{student_name}_{count}.jpg")
cv2.imwrite(face_path, face)
count += 1

cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)


status_label_capture.config(text=f"Captured {count}/5 images for
{student_name}", fg="blue")

if count >= 5:
status_label_capture.config(text=f"✅ {student_name} registered
successfully!", fg="green")
cap.release()
subprocess.run(["python", "n:\\project\\Mini Project\\Mini Project\\
Student_attendence Python-Project\\code\\01_facial updated.py"], check=True)
return_to_entry_page()
return

frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)


img = Image.fromarray(frame)
img = ImageTk.PhotoImage(img)
video_label.img = img
video_label.config(image=img)
root.after(10, capture_faces)

def return_to_entry_page():
global cap
if cap:
cap.release()
page2_frame.pack_forget()
page1_frame.pack(fill="both", expand=True)
21

# Start Tkinter event loop


root.mainloop()

2. Attendance Monitor :
import face_recognition
import cv2
import numpy as np
import os
import pandas as pd
from datetime import datetime
import tkinter as tk
from tkinter import Label, Frame
from PIL import Image, ImageTk
import threading
import random
import time

# Load student images & encode them


path = "students_faces"
known_face_encodings = []
known_face_names = []

for filename in os.listdir(path):


img_path = os.path.join(path, filename)
img = face_recognition.load_image_file(img_path)
encoding = face_recognition.face_encodings(img)

if encoding:
known_face_encodings.append(encoding[0])
name = filename.split("_")[0] # Extract student name
known_face_names.append(name)

# Initialize attendance file


file_path = "attendance_records.xlsx"
if not os.path.exists(file_path):
df = pd.DataFrame(columns=["Name", "Date", "Time", "Month", "Year"])
df.to_excel(file_path, index=False)

# Predefined unique greetings


greetings_dict = {
22

"Alice": "Hey Alice! Hope you're having a great day! 😊",


"Bob": "Welcome back, Bob! Keep up the great work! 🚀",
"Charlie": "Good to see you, Charlie! Stay awesome! 🌟",
"David": "Hello David! Let's make today amazing! 💪",
"Eve": "Hi Eve! You’re looking great today! 😃",
}

# Default greetings for new names


default_greetings = [
"Hello, {}! Have a fantastic day! 🎉",
"Welcome, {}! Keep shining bright! ✨",
"Nice to see you, {}! Stay positive! 🌈",
"Hey {}, let's make today productive! 🚀",
]

# Initialize Tkinter GUI


root = tk.Tk()
root.title("Face Recognition Attendance System")
root.geometry("900x700") # Increased height for better spacing

# Function to close the application


def close_app(event=None):
if cap.isOpened():
cap.release()
cv2.destroyAllWindows()
root.quit()

# Bind the Esc key to close the application


root.bind("<Escape>", close_app)

# Load Background Image


try:
bg_image = Image.open("bgi.jpg")
bg_image = bg_image.resize((900, 700), Image.LANCZOS)
bg_photo = ImageTk.PhotoImage(bg_image)
except:
bg_photo = None # If background image is missing, use default color

# Load College Logo (Optional)


try:
logo_image = Image.open("logokgce.png")
logo_image = logo_image.resize((100, 100), Image.LANCZOS)
23

logo_photo = ImageTk.PhotoImage(logo_image)
except:
logo_photo = None # If logo is missing, leave it empty

# Create a Canvas for Background


canvas = tk.Canvas(root, width=900, height=700)
canvas.pack(fill="both", expand=True)

if bg_photo:
canvas.create_image(0, 0, anchor="nw", image=bg_photo) # Background
Image

# College Logo at Top Left (Optional)


if logo_photo:
canvas.create_image(10, 10, anchor="nw", image=logo_photo)

# ======= Camera Frame with Border =======


camera_frame = Frame(root, bg="black", width=500, height=350)
canvas.create_window(450, 200, window=camera_frame)

# Video Label Inside Camera Frame


video_label = Label(camera_frame, bg="white")
video_label.place(relx=0.5, rely=0.5, anchor="center") # Centered inside the
frame

# Recognized Name Label (Below Camera)


name_label = Label(root, text="", font=("Arial", 16, "bold"), fg="blue",
bg="white")
canvas.create_window(450, 400, window=name_label)

# Confirmation Message Label (Below Name Label)


confirmation_label = Label(root, text="", font=("Arial", 12), fg="green",
bg="white")
canvas.create_window(450, 430, window=confirmation_label)

# Greeting Message Label (Below Confirmation Message)


greeting_label = Label(root, text="", font=("Arial", 14, "bold"), fg="purple",
bg="white")
canvas.create_window(450, 460, window=greeting_label)

# Quit Button (Below Everything)


24

exit_button = tk.Button(root, text="Exit", font=("Arial", 14),


command=close_app, bg="red", fg="white", padx=10, pady=5)
canvas.create_window(450, 520, window=exit_button) # Positioned at the
bottom center

# Initialize Camera
cap = cv2.VideoCapture(0)
recorded_names = set()
greeted_names = {} # Dictionary to store greetings per session
last_detected_time = time.time() # Track the last time a face was detected
camera_active = True # Track whether the camera is currently active

# Function to turn off the camera


def turn_off_camera():
global cap, camera_active
if cap.isOpened():
cap.release()
camera_active = False
print("Camera turned off due to inactivity.")

# Display a black screen


black_image = np.zeros((350, 500, 3), dtype=np.uint8) # Black image of the
same size as the camera frame
black_image = Image.fromarray(black_image)
black_image = ImageTk.PhotoImage(black_image)
video_label.img = black_image
video_label.config(image=black_image)

# Function to turn on the camera


def turn_on_camera():
global cap, camera_active
if not camera_active:
cap = cv2.VideoCapture(0)
camera_active = True
print("Camera turned on due to activity.")

# Function to update confirmation message


def show_confirmation_message(name):
now = datetime.now().strftime("%H:%M:%S")
confirmation_label.config(text=f"✔ Entry Recorded: {name} at {now}")
root.after(2000, lambda: confirmation_label.config(text="")) # Auto-hide
after 2 sec
25

# Function to get a unique greeting for each person


def get_greeting(name):
if name in greetings_dict:
return greetings_dict[name]
else:
return random.choice(default_greetings).format(name)

# Function to save attendance once per day


def save_attendance(name):
# Load the existing attendance records
df = pd.read_excel(file_path)
now = datetime.now()
current_date = now.strftime("%Y-%m-%d")
current_time = now.strftime("%H:%M:%S")
current_month = now.strftime("%B") # Get full month name
current_year = now.strftime("%Y")

# Check if the entry for this person already exists today


existing_entry = df[(df["Name"] == name) & (df["Date"] == current_date)]

if existing_entry.empty:
# Add a new entry if it doesn't exist for today
new_entry = pd.DataFrame({
"Name": [name],
"Date": [current_date],
"Time": [current_time],
"Month": [current_month],
"Year": [current_year]
})
df = pd.concat([df, new_entry], ignore_index=True)

# Save the updated DataFrame back to the Excel file


df.to_excel(file_path, index=False)

# Handle repeated attendance logic


handle_repeated_attendance(name, current_date, current_time)

# Function to handle repeated attendance logic


def handle_repeated_attendance(name, current_date, current_time):
repeated_file_path = "repeated_attendance_records.xlsx"
26

# Check if the repeated attendance file exists


if not os.path.exists(repeated_file_path):
repeated_df = pd.DataFrame(columns=["Name", "Date", "Time"])
repeated_df.to_excel(repeated_file_path, index=False)
else:
repeated_df = pd.read_excel(repeated_file_path)

# Add or update the repeated attendance record


existing_repeated_entry = repeated_df[(repeated_df["Name"] == name) &
(repeated_df["Date"] == current_date)]

if not existing_repeated_entry.empty:
# Update the time for the repeated entry
repeated_df.loc[(repeated_df["Name"] == name) & (repeated_df["Date"]
== current_date), "Time"] = current_time
else:
# Add a new entry if it doesn't exist
new_repeated_entry = pd.DataFrame({
"Name": [name],
"Date": [current_date],
"Time": [current_time]
})
repeated_df = pd.concat([repeated_df, new_repeated_entry],
ignore_index=True)

# Save the updated repeated attendance DataFrame back to the Excel file
repeated_df.to_excel(repeated_file_path, index=False)

# Function to process video and detect faces


def process_video():
global cap, greeted_names, last_detected_time, camera_active

# Check if the camera is active


if not camera_active:
root.after(100, process_video) # Check again after 100ms
return

ret, frame = cap.read()


if not ret:
return

# Resize frame for faster processing


27

small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)


rgb_small_frame = cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB)

# Detect faces
face_locations = face_recognition.face_locations(rgb_small_frame)
face_encodings = face_recognition.face_encodings(rgb_small_frame,
face_locations)

recognized_name = "Unknown"
is_person_present = False

for face_encoding in face_encodings:


matches = face_recognition.compare_faces(known_face_encodings,
face_encoding)
face_distances = face_recognition.face_distance(known_face_encodings,
face_encoding)
best_match_index = np.argmin(face_distances)
if matches[best_match_index]:
recognized_name = known_face_names[best_match_index]
is_person_present = True

# Update attendance only if it's a new entry for today


if recognized_name not in recorded_names:
recorded_names.add(recognized_name)
# Save attendance with filtering (only once per day)
save_attendance(recognized_name)

# Show confirmation message


show_confirmation_message(recognized_name)

# Assign and display a unique greeting message per person


if recognized_name not in greeted_names:
greeted_names[recognized_name] = get_greeting(recognized_name)
greeting_label.config(text=greeted_names[recognized_name])

# If no person is detected, remove the greeting message


if not is_person_present:
greeting_label.config(text="")

# Display name below camera feed


name_label.config(text=f"Recognized: {recognized_name}")
# Convert OpenCV frame to ImageTk format
28

frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)


img = Image.fromarray(frame)
img = ImageTk.PhotoImage(img)
video_label.img = img
video_label.config(image=img)

# Update the last detected time if a person is present


if is_person_present:
last_detected_time = time.time()
else:
# Check if 10 seconds have passed since the last detection
if time.time() - last_detected_time > 10: # Reduced from 15 to 10 seconds
turn_off_camera()

# Repeat function
root.after(10, process_video)

# Function to monitor for motion and turn on the camera


def monitor_motion():
global cap, camera_active

if not camera_active:
# Try to detect motion (e.g., check if the camera can detect any frame)
temp_cap = cv2.VideoCapture(0)
ret, _ = temp_cap.read()
temp_cap.release()

if ret: # If a frame is detected, turn on the camera


turn_on_camera()

# Repeat function
root.after(1000, monitor_motion) # Check every second

# Start the motion monitoring function


monitor_motion()

# Run video processing in a separate thread to avoid freezing UI


video_thread = threading.Thread(target=process_video)
video_thread.daemon = True
video_thread.start()
# Start the Tkinter GUI event loop
root.mainloop()
29

GUI OF SYSTEM :
30

CONCLUSION & SCOPE FOR


FUTRURE DEVLOPMENT
31

Limitation of Project on Bank Management System

Although significant efforts have been made to make the Automated Attendance
System efficient, user-friendly, and reliable, certain limitations cannot be overlooked. While
the system provides a wide range of functionalities, some intricate features could not be
incorporated due to logistical constraints and the lack of advanced resources. The limited time
available for development also posed a major challenge, preventing the implementation of
certain dynamic and foolproof features.
The system is designed to be easy to operate, even for users with minimal technical
expertise. However, first-time users may find it slightly challenging to understand the
workflow initially. Additionally, the system currently lacks advanced features such as
database integration for long-term storage of attendance records, multi-camera support for
larger environments, and enhanced recognition capabilities under varying lighting conditions.
Despite these limitations, considerable efforts have been made to ensure that the
system is intuitive and provides help at each step to guide the user. Future enhancements and
additional development time can address these limitations to make the system more robust
and dynamic.
32

Conclusion

This project was successfully completed within the allotted time frame. The
Automated Attendance System has been developed using Python and incorporates advanced
face recognition technology. All the modules were tested individually and then integrated to
form the complete system. Finally, the system was tested with real data, and all
functionalities worked successfully. Thus, the system has fulfilled all the objectives
identified during the planning phase.
The system has been designed with a user-friendly interface, ensuring that even users
with minimal technical knowledge can operate it with ease. It provides seamless interactions
between administrators and the attendance management process. The system maintains
speed and accuracy in real-time face recognition and attendance recording, ensuring
reliability and efficiency. This project successfully automates the attendance process,
reducing manual effort and improving overall productivity.
33

REFERENCES

 https://www.python.org/

 https://opencv.org/

 https://pandas.pydata.org/

 https://github.com/ageitgey/face_recognition

 https://www.geeksforgeeks.org/python/

 https://www.w3schools.com/python/

 https://en.wikipedia.org/wiki/Face_recognition

You might also like