-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
90 lines (73 loc) · 2.09 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
import os
import CameraCheck
import ImageCapture
import ImageTrainer
import Recognize
import remove_user
def title_bar():
# os.system('clear')
os.system('cls')
# title of the program
print("\t**********************************************")
print("\t***** Face Recognition Attendance System *****")
print("\t**********************************************")
def main_menu():
title_bar()
print(10 * "*", "WELCOME MENU", 10 * "*")
print("[1] Check Camera")
print("[2] New User")
print("[3] Train Image")
print("[4] Record Attendance")
print("[5] Remove User")
print("[6] Quit")
while True:
choice = int(input("Enter Choice: "))
if choice == 1:
check_camera()
break
elif choice == 2:
CaptureImage()
break
elif choice == 3:
train_image()
break
elif choice == 4:
record_attendance()
break
elif choice == 5:
remove_user()
break
elif choice == 6:
print("Have a Nice Day!")
break
else:
print("Invalid Choice. Enter 1-5")
main_menu()
# try:
# except ValueError:
# print("Invalid Choice. Enter 1-5\n Try Again")
# exit
def check_camera():
CameraCheck.camera_check()
input("Enter any key to return main menu")
main_menu()
def CaptureImage():
ImageCapture.capture_image()
input("Enter any key to return main menu")
main_menu()
def record_attendance():
Recognize.recognize_attendance()
input("Enter any key to return main menu")
main_menu()
def remove_user():
print("Remove an existing User from the database\n This action cannot be undone")
user_id = str(input("Enter the id of the user you want to remove"))
remove_user.remove_user(user_id)
input("Enter any key to return main menu")
main_menu()
def train_image():
ImageTrainer.train_image()
input("Enter any key to return main menu")
main_menu()
if __name__ == "__main__":
main_menu()