-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
101 lines (78 loc) · 2.61 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
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##########Summer Research Internship#############")
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] Auto Mail")
print("[6] 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:
os.system("py automail.py")
mainMenu()
break
elif choice == 6:
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 ------------------
mainMenu()