|
| 1 | +from tkinter import* |
| 2 | +from tkinter import ttk |
| 3 | +from PIL import Image,ImageTk |
| 4 | +from student import Student |
| 5 | +import os |
| 6 | +from train import train |
| 7 | +from face_recognition import Face_Recognition |
| 8 | +from attendence import Attendence |
| 9 | +from help import Help |
| 10 | +import tkinter |
| 11 | + |
| 12 | +class Face_Recognition_System: |
| 13 | + def __init__(self,root): |
| 14 | + self.root=root |
| 15 | + self.root.geometry("1530x790+0+0") |
| 16 | + self.root.title("Face Recognition System") |
| 17 | + |
| 18 | + # first image |
| 19 | + img=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\Stanford.jpg") |
| 20 | + img=img.resize((500,150),Image.BILINEAR) |
| 21 | + self.photoimg=ImageTk.PhotoImage(img) |
| 22 | + |
| 23 | + f_lbl=Label(self.root,image=self.photoimg) |
| 24 | + f_lbl.place(x=0,y=0,width=500,height=150) |
| 25 | + |
| 26 | + # second image |
| 27 | + img1=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\facialrecognition.png") |
| 28 | + img1=img1.resize((500,150),Image.BILINEAR) |
| 29 | + self.photoimg1=ImageTk.PhotoImage(img1) |
| 30 | + |
| 31 | + f_lbl=Label(self.root,image=self.photoimg1) |
| 32 | + f_lbl.place(x=500,y=0,width=500,height=150) |
| 33 | + |
| 34 | + # third image |
| 35 | + img2=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\u.jpg") |
| 36 | + img2=img2.resize((500,150),Image.BILINEAR) |
| 37 | + self.photoimg2=ImageTk.PhotoImage(img2) |
| 38 | + |
| 39 | + f_lbl=Label(self.root,image=self.photoimg2) |
| 40 | + f_lbl.place(x=1000,y=0,width=500,height=150) |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + #bg image |
| 46 | + img3=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\bg1.jpg") |
| 47 | + img3=img3.resize((1530,710),Image.BILINEAR) |
| 48 | + self.photoimg3=ImageTk.PhotoImage(img3) |
| 49 | + |
| 50 | + bg_img=Label(self.root,image=self.photoimg3) |
| 51 | + bg_img.place(x=0,y=130,width=1530,height=710) |
| 52 | + |
| 53 | + title_lbl=Label(bg_img,text="FACE RECOGNITION ATTENDANCE SYSTEM SOFTWARE ",font =("heinrich",35,"italic"),bg="black",fg="red") |
| 54 | + title_lbl.place(x=0,y=0,width=1530,height=45) |
| 55 | + |
| 56 | + #student button |
| 57 | + img4=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\gettyimages-1022573162.jpg") |
| 58 | + img4=img4.resize((220,220),Image.BILINEAR) |
| 59 | + self.photoimg4=ImageTk.PhotoImage(img4) |
| 60 | + |
| 61 | + b1=Button(bg_img,image=self.photoimg4,command=self.student_details,cursor="hand2") |
| 62 | + b1.place(x=200,y=100,width=220,height=220) |
| 63 | + |
| 64 | + b1=Button(bg_img,text="Student details",command=self.student_details,cursor="hand2",font =("heinrich",15,"italic"),bg="darkred",fg="white") |
| 65 | + b1.place(x=200,y=300,width=220,height=40) |
| 66 | + |
| 67 | + |
| 68 | + #Detect face button |
| 69 | + img5=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\face_detector1.jpg") |
| 70 | + img5=img5.resize((220,220),Image.BILINEAR) |
| 71 | + self.photoimg5=ImageTk.PhotoImage(img5) |
| 72 | + |
| 73 | + b1=Button(bg_img,image=self.photoimg5,cursor="hand2", command=self.face_data) |
| 74 | + b1.place(x=500,y=100,width=220,height=220) |
| 75 | + |
| 76 | + b1=Button(bg_img,text="Face Detector",cursor="hand2", command=self.face_data,font =("heinrich",15,"italic"),bg="darkred",fg="white") |
| 77 | + b1.place(x=500,y=300,width=220,height=40) |
| 78 | + |
| 79 | + #attendence button |
| 80 | + img6=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\report.jpg") |
| 81 | + img6=img6.resize((220,220),Image.BILINEAR) |
| 82 | + self.photoimg6=ImageTk.PhotoImage(img6) |
| 83 | + |
| 84 | + b1=Button(bg_img,image=self.photoimg6,cursor="hand2",command=self.attendence_data) |
| 85 | + b1.place(x=800,y=100,width=220,height=220) |
| 86 | + |
| 87 | + b1=Button(bg_img,text="Attendence",cursor="hand2",command=self.attendence_data,font =("heinrich",15,"italic"),bg="darkred",fg="white") |
| 88 | + b1.place(x=800,y=300,width=220,height=40) |
| 89 | + |
| 90 | + |
| 91 | + #Help button |
| 92 | + img7=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\help-desk-customer-care-team-icon-blue-square-button-isolated-reflected-abstract-illustration-89657179.jpg") |
| 93 | + img7=img7.resize((220,220),Image.BILINEAR) |
| 94 | + self.photoimg7=ImageTk.PhotoImage(img7) |
| 95 | + |
| 96 | + b1=Button(bg_img,image=self.photoimg7,cursor="hand2",command=self.help_data) |
| 97 | + b1.place(x=1100,y=100,width=220,height=220) |
| 98 | + |
| 99 | + b1=Button(bg_img,text="Help Desk",cursor="hand2",command=self.help_data,font =("heinrich",15,"italic"),bg="darkred",fg="white") |
| 100 | + b1.place(x=1100,y=300,width=220,height=40) |
| 101 | + |
| 102 | + #train button |
| 103 | + img8=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\Train.jpg") |
| 104 | + img8=img8.resize((220,220),Image.BILINEAR) |
| 105 | + self.photoimg8=ImageTk.PhotoImage(img8) |
| 106 | + |
| 107 | + b1=Button(bg_img,image=self.photoimg8,cursor="hand2",command=self.train_data) |
| 108 | + b1.place(x=200,y=380,width=220,height=220) |
| 109 | + |
| 110 | + b1=Button(bg_img,text="Train Data",cursor="hand2",command=self.train_data,font =("heinrich",15,"italic"),bg="darkred",fg="white") |
| 111 | + b1.place(x=200,y=580,width=220,height=40) |
| 112 | + |
| 113 | + #Photos button |
| 114 | + img9=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\opencv_face_reco_more_data.jpg") |
| 115 | + img9=img9.resize((220,220),Image.BILINEAR) |
| 116 | + self.photoimg9=ImageTk.PhotoImage(img9) |
| 117 | + |
| 118 | + b1=Button(bg_img,image=self.photoimg9,cursor="hand2") |
| 119 | + b1.place(x=500,y=380,width=220,height=220) |
| 120 | + |
| 121 | + b1=Button(bg_img,text="Photos",cursor="hand2",font =("heinrich",15,"italic"),bg="darkred",fg="white") |
| 122 | + b1.place(x=500,y=580,width=220,height=40) |
| 123 | + |
| 124 | + #Devloper button |
| 125 | + img10=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\Team-Management-Software-Development.jpg") |
| 126 | + img10=img10.resize((220,220),Image.BILINEAR) |
| 127 | + self.photoimg10=ImageTk.PhotoImage(img10) |
| 128 | + |
| 129 | + b1=Button(bg_img,image=self.photoimg10,cursor="hand2") |
| 130 | + b1.place(x=800,y=380,width=220,height=220) |
| 131 | + |
| 132 | + b1=Button(bg_img,text="Developer",cursor="hand2",font =("heinrich",15,"italic"),bg="darkred",fg="white") |
| 133 | + b1.place(x=800,y=580,width=220,height=40) |
| 134 | + |
| 135 | + #Exitbutton |
| 136 | + img11=Image.open(r"E:\project\Face recognition system\Face-Recognition-Based-Attendance-System\college_images\exit.jpg") |
| 137 | + img11=img11.resize((220,220),Image.BILINEAR) |
| 138 | + self.photoimg11=ImageTk.PhotoImage(img11) |
| 139 | + |
| 140 | + b1=Button(bg_img,image=self.photoimg11,cursor="hand2",command=self.iExit) |
| 141 | + b1.place(x=1100,y=380,width=220,height=220) |
| 142 | + |
| 143 | + b1=Button(bg_img,text="Exit",cursor="hand2",command=self.iExit,font =("heinrich",15,"italic"),bg="darkred",fg="white") |
| 144 | + b1.place(x=1100,y=580,width=220,height=40) |
| 145 | + |
| 146 | + def open_img(self): |
| 147 | + os.startfile("data") |
| 148 | + |
| 149 | + # functions buttons |
| 150 | + |
| 151 | + def student_details(self): |
| 152 | + self.new_window=Toplevel(self.root) |
| 153 | + self.app=Student(self.new_window) |
| 154 | + def train_data(self): |
| 155 | + self.new_window=Toplevel(self.root) |
| 156 | + self.app=train(self.new_window) |
| 157 | + |
| 158 | + def face_data(self): |
| 159 | + self.new_window=Toplevel(self.root) |
| 160 | + self.app=Face_Recognition(self.new_window) |
| 161 | + def attendence_data(self): |
| 162 | + self.new_window=Toplevel(self.root) |
| 163 | + self.app=Attendence(self.new_window) |
| 164 | + def help_data(self): |
| 165 | + self.new_window=Toplevel(self.root) |
| 166 | + self.app=Help(self.new_window) |
| 167 | + |
| 168 | + def iExit(self): |
| 169 | + self.iExit=tkinter.messagebox.askyesno("Face Recognition","Are you sure to exit this page",parent=self.root) |
| 170 | + if self.iExit>0: |
| 171 | + self.root.destroy() |
| 172 | + else: |
| 173 | + return |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | +if __name__ == "__main__": |
| 197 | + root=Tk() |
| 198 | + obj=Face_Recognition_System(root) |
| 199 | + root.mainloop() |
| 200 | + |
| 201 | + |
| 202 | + |
0 commit comments