Project Report Attendance
Project Report Attendance
REPORT
on
\
SUBMITTED TO
SUBMITTED BY
Marks Details
1.
2.
ACKNOWLEDGEMENT
1. Introduction 1
2. Objectives 2
3. Methodology 3
4. System Analysis 4
6. Results
Conclusion
References
CHAPTER-1
INTRODUCTION
Face detection: An image is captured from which a human face is detected from
the cluttered surroundings.
Image normalization: In which the image need be standardized consistent with its
scale, orientation, pose, size, illumination etc. relative to the images stored within
database. This is a pivotal step in the process of recognition since the recognition
of the face will not be a successful process unless the attributes of the probe image
are more or less identical to the attributes of the faces stored in the database.
Feature extraction: In which distinctive attributes of the face are extracted for
recognition.
Existing system
In Existing system eigenfaces are widely employed in face-based attendance
systems due to their effectiveness in recognizing and verifying individuals. One
drawback is their sensitivity to lighting conditions, as variations in lighting can
negatively impact the accuracy of face recognition, leading to false results.
Additionally, eigenfaces may struggle to accurately identify faces with significant
pose variations, reducing their effectiveness in such scenarios. Another concern is
their vulnerability to spoofing attacks, where an individual can deceive the system
using photographs or facial imitations.
Proposed System
Face-based attendance systems using Local Binary Patterns Histograms (LBPH) are
widely utilized due to the effectiveness of the LBPH algorithm in face recognition
and attendance tracking. LBPH captures facial texture information by analyzing the
local patterns in an image. This method is robust to lighting variations and can
handle moderate pose variations, making it suitable for real-world scenarios. By
comparing the local binary patterns of an input face with the pre-registered patterns
in the system, LBPH enables accurate identification and verification. However,
challenges such as occlusion and extreme pose variations can still affect the system's
performance. Continuous research and improvement are necessary to address these
limitations and enhance the overall accuracy and reliability of face-based attendance
systems using LBPH.
PROBLEM STATEMENT
SELECTED SOFTWARE
IMPLEMENTATION ON (PYTHON):
What Is a Script?
Up to this point, I have concentrated on the interactive programming capability
of Python. This is a very useful capability that allows you to type in a program
and to have it executed immediately in an interactive mode.
Script:
Scripts are distinct from the core code of the application, which is usually
written in a different language, and are often created or at least modified by the
end-user. Scripts are often interpreted from source code or byte code, whereas
the applications they control are traditionally compiled to native machine code.
Program:
The program has an executable form that the computer can use directly to
execute the instructions. The same program in its human-readable source code
form, from which executable programs are derived (e.g., compiled)
Python
What is Python? Chances you are asking yourself this. You may have found this
book because you want to learn to program but don’t know anything about
programming languages. Or you may have heard of programming languages like C,
C++, C#, or Java and want to know what Python is and how it compares to “big
name” languages. Hopefully I can explain it for you.
Python concepts
If you not interested in the how and whys of Python, feel free to skip to the next
chapter. In this chapter I will try to explain to the reader why I think Python is one
of the best languages available and why it’s a great one to start programming with.
Open-source general-purpose language.
Object Oriented, Procedural, Functional
Easy to interface with C/ObjC/Java/Fortran
Easy-Ish to interface with C++ (via SWIG)
Great interactive environment
Python is Interactive − You can actually sit at a Python prompt and interact with
the interpreter directly to write your programs.
History of Python
Python was developed by Guido van Rossum in the late eighties and early
nineties at the National Research Institute for Mathematics and Computer
Science in the Netherlands.
Python is copyrighted. Like Perl, Python source code is now available under
the GNU General Public License (GPL).
Python is now maintained by a core development team at the institute,
although Guido van Rossum still holds a vital role in directing its progress
o Python Features
Python's features include −
Easy-to-read − Python code is more clearly defined and visible to the eyes.
A broad standard library − Python's bulk of the library is very portable and
cross-platform compatible on UNIX, Windows, and Macintosh.
Interactive Mode − Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.
Portable − Python can run on a wide variety of hardware platforms and has the
same interface on all platforms.
Extendable − You can add low-level modules to the Python interpreter. These
modules enable programmers to add to or customize their tools to be more
efficient.
GUI Programming − Python supports GUI applications that can be created and
ported to many system calls, libraries and windows systems, such as Windows
MFC, Macintosh, and the X Window system of Unix.
Scalable − Python provides a better structure and support for large programs
than shell scripting.
Apart from the above-mentioned features, Python has a big list of good features, few
are listed below –
It provides very high-level dynamic data types and supports dynamic type
checking.
It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
System Design
o There are technically 3 algorithms we can use, but we have used the LBPH (Local
Binary Pattern Histogram) which gives very efficient result. The other two are
Eigenface and Fisherface algorithms. LBPH is implemented using OpenCV
libraries.
o The input image is read by the camera of the system(webcam). After the image is
read it is converted into gray scale. The faces in the image are detected using the
Haar Cascade frontal face module. Using the LBPH algorithm, the faces in the
image are predicted. After the images are predicted, the recognized faces are
shown in a green box along with their names finally the attendance has been
marked and saved it into csv file.
UML Diagrams
The class diagram is the main building block of object oriented modeling. It is used
both for general conceptual modeling of the systematic of the application, and for
detailed modeling translating the models into programming code. Class diagrams
can also be used for data modeling. The classes in a class diagram represent both the
main objects, interactions in the application and the classes to be programmed. A
class with three sections, in the diagram, classes is represented with boxes which
contain three parts:
The bottom part gives the methods or operations the class can take or
undertake.
SEQUENCE DIAGRAM
Advantages
Robustness to lighting variations
Efficient and fast computation
Texture-based recognition
Low storage requirements
Well-established and widely used.
Disadvantages
Sensitivity to lighting conditions
Limited accuracy with pose variations
Vulnerability to spoofing attacks
Computational complexity
CHAPTER-6
SYSTEM SPECIFICATIONS
Software Specifications:
Operating system: Microsoft Windows 11 Home
Programming Language: Python Language
IDE: PYCHARM
Code Complier: Pycharm
Hardware Specifications:
CPU: Intel Core i5-11300H @3.60 to 4.80 GHz
GPU: Nvidia GeForce RTX 3060
RAM: 16GB LPDDR4x @4266 MHz
ROM: 512GB m.2 NVMe SSD
System type: 64-bit Processor Architecture Operating System
CHAPTER-7
IMPLEMENTATION
(SOURCE CODE)
import os.path
import datetime
import pickle
import tkinter as tk
import cv2
from PIL import Image, ImageTk
import face_recognition
import util
from test import test
class App:
def __init__(self):
self.main_window = tk.Tk()
self.main_window.geometry("1200x520+350+100")
self.webcam_label = util.get_img_label(self.main_window)
self.webcam_label.place(x=10, y=0, width=700, height=500)
self.add_webcam(self.webcam_label)
self.db_dir = './db'
if not os.path.exists(self.db_dir):
os.mkdir(self.db_dir)
self.log_path = './log.txt'
def process_webcam(self):
ret, frame = self.cap.read()
self.most_recent_capture_arr = frame
img_ = cv2.cvtColor(self.most_recent_capture_arr, cv2.COLOR_BGR2RGB)
self.most_recent_capture_pil = Image.fromarray(img_)
imgtk = ImageTk.PhotoImage(image=self.most_recent_capture_pil)
self._label.imgtk = imgtk
self._label.configure(image=imgtk)
self._label.after(20, self.process_webcam)
def login(self):
label = test(
image=self.most_recent_capture_arr,
model_dir='/home/phillip/Desktop/todays_tutorial/27_face_recognition_spoofing/code/face-
attendance-system/Silent-Face-Anti-Spoofing/resources/anti_spoof_models',
device_id=0
)
if label == 1:
else:
util.msg_box('Hey, you are a spoofer!', 'You are fake !')
def logout(self):
label = test(
image=self.most_recent_capture_arr,
model_dir='/home/phillip/Desktop/todays_tutorial/27_face_recognition_spoofing/code/face-
attendance-system/Silent-Face-Anti-Spoofing/resources/anti_spoof_models',
device_id=0
)
if label == 1:
else:
util.msg_box('Hey, you are a spoofer!', 'You are fake !')
def register_new_user(self):
self.register_new_user_window = tk.Toplevel(self.main_window)
self.register_new_user_window.geometry("1200x520+370+120")
self.accept_button_register_new_user_window =
util.get_button(self.register_new_user_window, 'Accept', 'green', self.accept_register_new_user)
self.accept_button_register_new_user_window.place(x=750, y=300)
self.try_again_button_register_new_user_window =
util.get_button(self.register_new_user_window, 'Try again', 'red', self.try_again_register_new_user)
self.try_again_button_register_new_user_window.place(x=750, y=400)
self.capture_label = util.get_img_label(self.register_new_user_window)
self.capture_label.place(x=10, y=0, width=700, height=500)
self.add_img_to_label(self.capture_label)
self.entry_text_register_new_user = util.get_entry_text(self.register_new_user_window)
self.entry_text_register_new_user.place(x=750, y=150)
def try_again_register_new_user(self):
self.register_new_user_window.destroy()
self.register_new_user_capture = self.most_recent_capture_arr.copy()
def start(self):
self.main_window.mainloop()
def accept_register_new_user(self):
name = self.entry_text_register_new_user.get(1.0, "end-1c")
embeddings = face_recognition.face_encodings(self.register_new_user_capture)[0]
self.register_new_user_window.destroy()
if __name__ == "__main__":
app = App()
app.start()
import os
import pickle
import tkinter as tk
from tkinter import messagebox
import face_recognition
return button
def get_img_label(window):
label = tk.Label(window)
label.grid(row=0, column=0)
return label
embeddings_unknown = face_recognition.face_encodings(img)
if len(embeddings_unknown) == 0:
return 'no_persons_found'
else:
embeddings_unknown = embeddings_unknown[0]
db_dir = sorted(os.listdir(db_path))
match = False
j=0
while not match and j < len(db_dir):
path_ = os.path.join(db_path, db_dir[j])
if match:
return db_dir[j - 1][:-7]
else:
return 'unknown_person'
CHAPTER-8
OUTPUT
CONCLUSION
[1] B.K.P. Horn and M. Brooks, Seeing Shape from Shading. Cambridge, Mass.:
MIT Press, 1989
[2] Kanan C, Cottrell GW (2012) Color-to-Grayscale: Does the Method Matter in
Image Recognition? https://doi.org/10.1371/journal.pone.0029740
[3] Grundland M, Dodgson N (2007) Decolorize: Fast, contrast enhancing, color to
grayscale conversion. Pattern Recognition 40: 2891- 2896.
[4] F. Ibikunle, Agbetuvi F. and Ukpere G. “Face Recognition Using Line Edge
Mapping Approach.” American Journal of Electrical and Electronic Engineering
1.3(2013): 52-59
[5] T. Kanade, Computer Recognition of Human Faces. Basel and Stuttgart:
Birkhauser Verlag 1997.
[6] K. Wong, H. Law, and P. Tsang, “A System for Recognizing Human Faces,”
Proc. ICASSP, pp. 1,6381,642, 1989.
[7] V. Govindaraju, D.B. Sher, R. Srihari, and S.N. Srihari, “Locating Human Faces
in Newspaper Photographs,” Proc. CVPR 89, pp. 549-554; 1989
[8] N. Dalal, B. Triggs “Histograms of oriented gradients for Human Detection”,
IEEE Computer Society Conference on Computer Vision and Pattern Recognition,
Vol. 1, 2005, pp. 886 – 893.
[9] Modern Face Recognition with Deep learning. Website Reference:
https://medium.com/@ageitgey/machine-learning-is-fun-part-4- modern-face-
recognitionwith-deep- learning.
[10] S.Edelman, D.Reisfeld, and Y. Yeshurun, “A System for Face Recognition that
Learns from Examples,” Proc. European Conf. Computer Vision, S. Sandini, ed., pp.
787-791. Springer- Verlag,1992.