-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
37 lines (24 loc) · 762 Bytes
/
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
# !/usr/bin/python3.6
import time
from application import Application
from facial_recog import FaceRecognizer
from facial_detect import FaceDetector
from tkinter import Tk
def facial_recognition():
recognizer = FaceRecognizer()
detector = FaceDetector()
detector.start()
while True:
time.sleep(.3)
try:
access, min_dist, identity = recognizer.who_is_it("images/camera_0.jpg")
detector.detected_face_name = identity.capitalize()
detector.access_status = access
detector.distance = f'dist: {min_dist}'
except TypeError as e:
print(str(e))
if __name__ == '__main__':
root = Tk()
Application(root)
root.mainloop()
# facial_recognition()