-
Notifications
You must be signed in to change notification settings - Fork 0
/
face_app.py
34 lines (25 loc) · 958 Bytes
/
face_app.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
import os
import shutil
import cv2
from recognizer import face_recognizer
from create_classifier import train_classifer
from create_dataset import start_capture
name = input("Enter your name once! ")
def face_recognition(username):
if os.path.exists("data/{}".format(username)):
face_recognizer(username)
print("Person recognized as: {}".format(username))
input('Press Enter to Exit...')
if not os.path.exists("data/classifiers/{}_classifier.xml".format(username)):
# name = input("Enter your name once! ")
start_capture(username)
train_classifer(username)
if os.path.exists("data/{}".format(username)):
shutil.rmtree("data/{}".format(username))
if face_recognizer(username):
print("Welcome to DoctorAi: {}".format(username))
input('Press Enter to Exit...')
else:
print("Unknown face")
input('Press Enter to Exit...')
face_recognition(name)