forked from BakedBeans900/HackBIProject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
21 lines (17 loc) · 773 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#Main.py
import facialRecognition as fR
import coredatabase as cdb
import time
import os
profile_folder_path = os.getcwd() + "/profile_images"
cdb.create_table("profiles", "name TEXT, age INTEGER, birthdate TEXT, crime TEXT, priority INTEGER, images_path TEXT")
cdb.create_table("matching_logs", "time TEXT, location TEXT, name TEXT")
fR.trainRecognizer(profile_folder_path)
os.chdir('..')#Back to project top folder
for input_image_name in os.listdir(os.getcwd() + "/raw_images"):
matched = fR.match("/home/development/HackBIProject" + "/raw_images", input_image_name)
local_time = time.asctime(time.localtime(time.time()))
os.chdir('..')
cdb.add_matching_logs(local_time, "BI", fR.subject[matched[0]])
for lo in cdb.location_logs("BI"):
print(lo)