-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
54 lines (42 loc) · 1.41 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
"""
Created on Sun Oct 21 02:26:02 2018
@author: Vedantika Chaudhary
"""
from PyQt5.QtWidgets import QApplication
import faceRecognition
import faceDetection
from pathlib import Path
import login
import encode
import turnoff
from GUI import App
import os
import time
import sys
WRITE_FILE = "/Users/zak/Desktop/Project_Theia/users/collin.txt" #has to be changed
PATH_TO_USERINFO ="/Users/zak/Desktop/Project_Theia/login.txt" # please fill
if __name__ == '__main__':
my_file = Path(WRITE_FILE)
print(my_file.is_file())
if my_file.is_file():
if(faceRecognition.recognize()):
faceDetection.detect_face()
else:
app = QApplication([])
ex = App(imgpath="/Library/User Pictures/Nature/Leaf.tif")
app.exec_()
a = ex.auth()
if(a == 1):
faceDetection.detect_face()
else:
os.remove(WRITE_FILE)
os.remove(PATH_TO_USERINFO)
import subprocess
subprocess.call('/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend', shell=True)
else:
login.get_dataSet()
encode.generate_encodings()
app = QApplication([])
ex = App(imgpath="/Library/User Pictures/Nature/Leaf.tif")
ex.register()
app.exec_()