-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
194 lines (146 loc) · 4.88 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<<<<<<< HEAD
import os # accessing the os functions
import check_camera
import Capture_Image
import Train_Image
import Recognize
# creating the title bar function
def title_bar():
os.system('cls') # for windows
# title of the program
print("\t**********************************************")
print("\t***** Face Recognition Attendance System *****")
print("\t**********************************************")
# creating the user main menu function
def mainMenu():
title_bar()
print()
print(10 * "*", "WELCOME MENU", 10 * "*")
print("[1] Check Camera")
print("[2] Capture Faces")
print("[3] Train Images")
print("[4] Recognize & Attendance")
print("[5] Quit")
while True:
try:
choice = int(input("Enter Choice: "))
if choice == 1:
checkCamera()
break
elif choice == 2:
CaptureFaces()
break
elif choice == 3:
Trainimages()
break
elif choice == 4:
RecognizeFaces()
break
elif choice == 5:
print("Thank You")
break
else:
print("Invalid Choice. Enter 1-4")
mainMenu()
except ValueError:
print("Invalid Choice. Enter 1-4\n Try Again")
exit
# ---------------------------------------------------------
# calling the camera test function from check camera.py file
def checkCamera():
check_camera.camer()
key = input("Enter any key to return main menu")
mainMenu()
# --------------------------------------------------------------
# calling the take image function form capture image.py file
def CaptureFaces():
Capture_Image.takeImages()
key = input("Enter any key to return main menu")
mainMenu()
# -----------------------------------------------------------------
# calling the train images from train_images.py file
def Trainimages():
Train_Image.TrainImages()
key = input("Enter any key to return main menu")
mainMenu()
# --------------------------------------------------------------------
# calling the recognize_attendance from recognize.py file
def RecognizeFaces():
Recognize.recognize_attendence()
key = input("Enter any key to return main menu")
mainMenu()
# ---------------main driver ------------------
=======
import os # accessing the os functions
import check_camera
import Capture_Image
import Train_Image
import Recognize
# creating the title bar function
def title_bar():
os.system('cls') # for windows
# title of the program
print("\t**********************************************")
print("\t***** Face Recognition Attendance System *****")
print("\t**********************************************")
# creating the user main menu function
def mainMenu():
title_bar()
print()
print(10 * "*", "WELCOME MENU", 10 * "*")
print("[1] Check Camera")
print("[2] Capture Faces")
print("[3] Train Images")
print("[4] Recognize & Attendance")
print("[5] Quit")
while True:
try:
choice = int(input("Enter Choice: "))
if choice == 1:
checkCamera()
break
elif choice == 2:
CaptureFaces()
break
elif choice == 3:
Trainimages()
break
elif choice == 4:
RecognizeFaces()
break
elif choice == 5:
print("Thank You")
break
else:
print("Invalid Choice. Enter 1-4")
mainMenu()
except ValueError:
print("Invalid Choice. Enter 1-4\n Try Again")
exit
# ---------------------------------------------------------
# calling the camera test function from check camera.py file
def checkCamera():
check_camera.camer()
key = input("Enter any key to return main menu")
mainMenu()
# --------------------------------------------------------------
# calling the take image function form capture image.py file
def CaptureFaces():
Capture_Image.takeImages()
key = input("Enter any key to return main menu")
mainMenu()
# -----------------------------------------------------------------
# calling the train images from train_images.py file
def Trainimages():
Train_Image.TrainImages()
key = input("Enter any key to return main menu")
mainMenu()
# --------------------------------------------------------------------
# calling the recognize_attendance from recognize.py file
def RecognizeFaces():
Recognize.recognize_attendence()
key = input("Enter any key to return main menu")
mainMenu()
# ---------------main driver ------------------
>>>>>>> master
mainMenu()