MINI PROJECT REPORT FORMAT Part 2
MINI PROJECT REPORT FORMAT Part 2
Submitted by
BACHELOR OF ENGINEERING
IN
APRIL/MAY 2022
ANNA UNIVERSITY: CHENNAI 600 025
BONAFIDE CERTIFICATE
(952820104078),S.Sivakumar(952820104065)A.Princesamuvel(9528201045
SIGNATURE SIGNATURE
DR.A.VEGI FERNANDO M.E.(Ph.D) DR.S.RAM PRASAD M.E (Ph.D)
HEAD OF THE DEPARTMENT SUPERVISOR
Designation Designation
Department of Computer Science and Department of Computer Science and
Engineering Engineering
SCAD College of Engineering and SCAD College of Engineering and
Technology Technology
Tirunelveli - 627414 Tirunelveli - 627414
Submitted for the Anna University Mini Project Viva voce held at SCAD
APPENDICES
I SCREEN SHOTS
II SOURCE CODE
III REFERENCES
ABSTRACT
INTRODUCTION
OBJECTIVES
FLOW DIAGRAM
EXISTING SYSTEM
Prior to the development of face attendance systems, attendance
management in many organizations relied on manual methods or
traditional identification systems. Here are some of the existing
systems that were used before the adoption of face attendance
systems:
DRAWBACKS
PROPOSED SYSTEM
1. Contactless Attendance Tracking: The proposed system eliminates
the need for physical contact or identification devices. Individuals'
attendance is recorded by capturing their facial images or video
streams using high-resolution cameras or webcams. This contactless
approach promotes hygiene and addresses public health concerns.
HARDWARE REQUIREMENTS
1. Cameras or Webcams: High-resolution cameras or webcams are
essential components of a face attendance system. They capture facial
images or video streams for identification purposes. The cameras
should have sufficient resolution and image quality to ensure accurate
facial recognition.
2. Server or Computer System: A server or computer system is
required to host the face attendance system software and handle the
processing of facial recognition algorithms. The server or computer
system should have sufficient processing power, memory, and storage
capacity to handle the data processing requirements of the system.
SOFTWARE REQUIREMENTS
1. Facial Recognition Software
2. Attendance Management Software
3. Database Management System
4. Network Communication Protocol
5. Operating System
6. Security Software
7. Integration Interfaces/APIs
8. System Monitoring and Logging Tools
9. Software Development Kit (SDK)
SOFTWARE DETAILS
MODULES DESCRIPTION
Automated Attendance System has been envisioned for the purpose of reducing
the errors that occur in the traditional (manual) attendance taking system. The
aim is to automate and make a system that is useful to the organization such as
an institute. The efficient and accurate method of attendance in the office
environment that can replace the old manual methods. This method is secure
enough, reliable and available for use. No need for specialized hardware for
installing the system in the office. It can be constructed using a camera and
computer.
SNAPSHOTS
1.OVERALL INTERFACE
2.STUDENT DETAILS
+
SOURCE CODE:
CODE OF MAIN.PY
class Face_Recognition_System:
def __init__(self,root):
self.root=root
self.root.geometry("1530x790+0+0")
self.root.title("Face Recognition System")
#===========img1
img=Image.open("images/3.jpg")
img=img.resize((500,130),Image.ANTIALIAS)
self.photoimg=ImageTk.PhotoImage(img)
f_lbl=Label(self.root,image=self.photoimg)
f_lbl.place(x=0,y=0,width=500,height=130)
#===========img2
img1=Image.open("images/2.jpg")
img1=img1.resize((500,130),Image.ANTIALIAS)
self.photoimg1=ImageTk.PhotoImage(img1)
f_lbl=Label(self.root,image=self.photoimg1)
f_lbl.place(x=500,y=0,width=500,height=130)
#============img3
img2=Image.open("images/3.jpg")
img2=img2.resize((500,130),Image.ANTIALIAS)
self.photoimg2=ImageTk.PhotoImage(img2)
f_lbl=Label(self.root,image=self.photoimg2)
f_lbl.place(x=1000,y=0,width=550,height=130)
#==============bgimg
img3=Image.open("images/bg2.webp")
img3=img3.resize((1530,710),Image.ANTIALIAS)
self.photoimg3=ImageTk.PhotoImage(img3)
bg_img=Label(self.root,image=self.photoimg3)
bg_img.place(x=0,y=130,width=1530,height=710)
#=============time=========
def time():
string = strftime('%H:%M:%S %p')
lbl.config(text = string)
lbl.after(1000, time)
#==========stdnt button
img4=Image.open("images/st.jpg")
img4=img4.resize((220,220),Image.ANTIALIAS)
self.photoimg4=ImageTk.PhotoImage(img4)
b1=Button(bg_img,image=self.photoimg4,command=self.student_details,cursor
="hand2")
b1.place(x=200,y=100,width=220,height=220)
b1_1=Button(bg_img,text="Student
Details",command=self.student_details,cursor="hand2",font=("times new
roman",15,"bold"),bg="darkblue",fg="white" )
b1_1.place(x=200,y=300,width=220,height=40)
b1=Button(bg_img,image=self.photoimg5,cursor="hand2",command=self.face_
data)
b1.place(x=500,y=100,width=220,height=220)
b1_1=Button(bg_img,text="Face
Detector",cursor="hand2",command=self.face_data,font=("times new
roman",15,"bold"),bg="darkblue",fg="white" )
b1_1.place(x=500,y=300,width=220,height=40)
#==========attendance button
img6=Image.open("images/att.jpg")
img6=img6.resize((220,220),Image.ANTIALIAS)
self.photoimg6=ImageTk.PhotoImage(img6)
b1=Button(bg_img,image=self.photoimg6,cursor="hand2",command=self.atten
dance_data)
b1.place(x=800,y=100,width=220,height=220)
b1_1=Button(bg_img,text="Attendance",cursor="hand2",command=self.attend
ance_data,font=("times new roman",15,"bold"),bg="darkblue",fg="white" )
b1_1.place(x=800,y=300,width=220,height=40)
#==========Help button
img7=Image.open("images/help.png")
img7=img7.resize((220,220),Image.ANTIALIAS)
self.photoimg7=ImageTk.PhotoImage(img7)
b1=Button(bg_img,image=self.photoimg7,cursor="hand2",command=self.help_
data)
b1.place(x=1100,y=100,width=220,height=220)
b1_1=Button(bg_img,text="Help
Desk",cursor="hand2",command=self.help_data,font=("times new
roman",15,"bold"),bg="darkblue",fg="white" )
b1_1.place(x=1100,y=300,width=220,height=40)
b1=Button(bg_img,image=self.photoimg8,cursor="hand2",command=self.train
_data)
b1.place(x=200,y=380,width=220,height=220)
b1_1=Button(bg_img,text="Train
Face",cursor="hand2",command=self.train_data,font=("times new
roman",15,"bold"),bg="darkblue",fg="white" )
b1_1.place(x=200,y=580,width=220,height=40)
#==========Photo button
img9=Image.open("images/photo.webp")
img9=img9.resize((220,220),Image.ANTIALIAS)
self.photoimg9=ImageTk.PhotoImage(img9)
b1=Button(bg_img,image=self.photoimg9,cursor="hand2",command=self.open
_img)
b1.place(x=500,y=380,width=220,height=220)
b1_1=Button(bg_img,text="Photos",cursor="hand2",command=self.open_img,f
ont=("times new roman",15,"bold"),bg="darkblue",fg="white" )
b1_1.place(x=500,y=580,width=220,height=40)
#==========dev button
img10=Image.open("images/dev.png")
img10=img10.resize((220,220),Image.ANTIALIAS)
self.photoimg10=ImageTk.PhotoImage(img10)
b1=Button(bg_img,image=self.photoimg10,cursor="hand2",command=self.dev
eloper_data)
b1.place(x=800,y=380,width=220,height=220)
b1_1=Button(bg_img,text="Developer",cursor="hand2",command=self.develop
er_data,font=("times new roman",15,"bold"),bg="darkblue",fg="white" )
b1_1.place(x=800,y=580,width=220,height=40)
#==========Exit button
img11=Image.open("images/exit.webp")
img11=img11.resize((220,220),Image.ANTIALIAS)
self.photoimg11=ImageTk.PhotoImage(img11)
b1=Button(bg_img,image=self.photoimg11,cursor="hand2",command=self.iExi
t)
b1.place(x=1100,y=380,width=220,height=220)
b1_1=Button(bg_img,text="Exit",cursor="hand2",command=self.iExit,font=("ti
mes new roman",15,"bold"),bg="darkblue",fg="white" )
b1_1.place(x=1100,y=580,width=220,height=40)
def open_img(self):
os.startfile("data")
def iExit(self):
self.iExit=tkinter.messagebox.askyesno("Face Recognition","Are You
Sure You want to Exit?",parent=self.root)
if self.iExit >0:
self.root.destroy()
else:
return
#=================Function buttons
def student_details(self):
self.new_window=Toplevel(self.root)
self.app=Student(self.new_window)
def train_data(self):
self.new_window=Toplevel(self.root)
self.app=Train(self.new_window)
def face_data(self):
self.new_window=Toplevel(self.root)
self.app=Face_Recognition(self.new_window)
def attendance_data(self):
self.new_window=Toplevel(self.root)
self.app=Attendance(self.new_window)
def developer_data(self):
self.new_window=Toplevel(self.root)
self.app=Developer(self.new_window)
def help_data(self):
self.new_window=Toplevel(self.root)
self.app=Help(self.new_window)
if __name__=="__main__":
root=Tk()
obj=Face_Recognition_System(root)
root.mainloop()
class Train:
def __init__(self, root):
self.root = root
self.root.geometry("1530x790+0+0")
self.root.title("Face Recognition System")
img_top = Image.open("images/3.jpg")
img_top = img_top.resize((1530, 325), Image.ANTIALIAS)
self.photoimg_top = ImageTk.PhotoImage(img_top)
# button
b1_1 = Button(self.root, text="TRAIN DATA", cursor="hand2",
command=self.train_classifier,
font=("times new roman", 15, "bold"), bg="darkblue",
fg="white")
b1_1.place(x=0, y=380, width=1530, height=60)
img_bottom = Image.open("images/3.jpg")
img_bottom = img_bottom.resize((1530, 325), Image.ANTIALIAS)
self.photoimg_bottom = ImageTk.PhotoImage(img_bottom)
def train_classifier(self):
data_dir = ("data")
path = [os.path.join(data_dir, file) for file in os.listdir(data_dir)]
faces = []
ids = []
faces.append(imageNp)
ids.append(id)
cv2.imshow("Training", imageNp)
cv2.waitKey(1) == 13
ids = np.array(ids)
# faces=np.array(faces)
# ===========Train Claasifier and Save===========
clf = cv2.face.LBPHFaceRecognizer_create()
clf.train(faces, ids)
clf.write("classifier.xml")
cv2.destroyAllWindows()
messagebox.showinfo("Result", "Training Datasets Completed!")
if __name__ == "__main__":
root = Tk()
obj = Train(root)
root.mainloop()
class Face_Recognition:
def __init__(self, root):
self.root = root
self.root.geometry("1530x790+0+0")
self.root.title("Face Recognition System")
title_lbl = Label(self.root, text="FACE RECOGNITION", font=("times
new roman", 25, "bold"), bg="white",fg="darkgreen")
title_lbl.place(x=0, y=0, width=1530, height=45)
#1st img
img_top = Image.open("images/ai3.jpg")
img_top = img_top.resize((650, 700), Image.ANTIALIAS)
self.photoimg_top = ImageTk.PhotoImage(img_top)
#2nd img
img_bottom = Image.open("images/ai.webp")
img_bottom = img_bottom.resize((950, 700), Image.ANTIALIAS)
self.photoimg_bottom = ImageTk.PhotoImage(img_bottom)
# button
b1_1 = Button(self.root, text="Face Recognition",
cursor="hand2",command=self.face_recog,font=("times new roman", 15,
"bold"), bg="dark green", fg="white")
b1_1.place(x=1025, y=675, width=200, height=40)
#============attenance============
def mark_attendance(self,i,r,n,d):
with open("vino.csv","r+",newline="\n") as f:
myDataList=f.readlines()
name_list=[]
for line in myDataList:
entry=line.split((","))
name_list.append(entry[0])
if((i not in name_list) and (r not in name_list) and (n not in name_list)
and (d not in name_list)):
now=datetime.now()
d1=now.strftime("%d/%m/%Y")
dtString=now.strftime("%H:%M:%S")
f.writelines(f"\n{i},{r},{n},{d},{dtString},{d1},Present")
#==============face recognition=============
def face_recog(self):
def
draw_boundray(img,classifier,scaleFactor,minNeighbors,color,text,clf):
gray_image=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
features=classifier.detectMultiScale(gray_image,scaleFactor,minNeighbors)
coord=[]
conn=mysql.connector.connect(host="localhost",username="root",password="1
2345678",database="face_recognition")
my_cursor=conn.cursor()
if confidence>77:
cv2.putText(img,f"std_id:{i}",(x,y-
75),cv2.FONT_HERSHEY_COMPLEX,0.8,(255,255,255),3)
cv2.putText(img,f"roll:{r}",(x,y-
55),cv2.FONT_HERSHEY_COMPLEX,0.8,(255,255,255),3)
cv2.putText(img,f"std_name:{n}",(x,y-
30),cv2.FONT_HERSHEY_COMPLEX,0.8,(255,255,255),3)
cv2.putText(img,f"dep:{d}",(x,y-
5),cv2.FONT_HERSHEY_COMPLEX,0.8,(255,255,255),3)
self.mark_attendance(i,r,n,d)
else:
cv2.rectangle(img,(x,y),(x+w,y+h),(0,0,255),3)
cv2.putText(img,f"Unknown Face",(x,y-
5),cv2.FONT_HERSHEY_COMPLEX,0.8,(255,255,255),3)
coord=[x,y,w,y]
return coord
def recognize(img,clf,faceCascade):
coord=draw_boundray(img,faceCascade,1.1,10,(255,25,255),"Face",clf)
return img
faceCascade=cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
clf=cv2.face.LBPHFaceRecognizer_create()
clf.read("classifier.xml")
video_cap=cv2.VideoCapture(0)
while True:
ret,img=video_cap.read()
img=recognize(img,clf,faceCascade)
cv2.imshow("Welcome to Face Recognition",img)
if cv2.waitKey(1)==13:
break
video_cap.release()
cv2.destroyAllWindows()
messagebox.showinfo("Result","Generating Dataset Completed !!")
if __name__ == "__main__":
root = Tk()
obj = Face_Recognition(root)
root.mainloop()
REFERENCES
[2]. Herbert Bay, Andreas Ess, Tinne Tuytelaars, and Luc Van Gool. Surf:
Speeded up robust features. Computer Vision and Image Understanding
(CVIU), 110(3):346–359.
[5]. Javier Ruiz Del Solar, Rodrigo Verschae, and Mauricio Correa. Face
recognition in unconstrained environments: A comparative study. In ECCV
Workshop on Faces in RealLife Images: Detection, Alignment, and
Recognition, Marseille, France, October 2008.
[7]. Osuna, E., Freund, R. and Girosit, F. (1997). "Training support vector
machines: an application to face detection." 130-136