Vehicle-Anti-Theft-Face-Rec.../start_engine.py

37 lines
1.6 KiB
Python
Raw Normal View History

2020-11-07 03:57:24 +00:00
import DBHelper
import Facial_Recognition_Software
2020-11-07 02:59:40 +00:00
def start():
2020-11-07 03:57:24 +00:00
# Downloads all the user and thief photos from database to the project folder first or updates them.
count = 0
users = DBHelper.db.child("Users").get()
try:
for user in users.each():
count = +1
DBHelper.download_user_photo("user" + str(count) + "_" + str(1) + ".jpg")
DBHelper.download_user_photo("user" + str(count) + "_" + str(2) + ".jpg")
DBHelper.download_user_photo("user" + str(count) + "_" + str(3) + ".jpg")
DBHelper.download_user_photo("user" + str(count) + "_" + str(4) + ".jpg")
DBHelper.download_user_photo("user" + str(count) + "_" + str(5) + ".jpg")
DBHelper.download_user_photo("user" + str(count) + "_" + str(6) + ".jpg")
DBHelper.download_user_photo("user" + str(count) + "_" + str(7) + ".jpg")
except:
print("No Users are registered.")
count = 0
try:
for user in users.each():
count = +1
DBHelper.download_thief_photo("user" + str(count) + "_" + str(1) + ".jpg")
DBHelper.download_thief_photo("user" + str(count) + "_" + str(2) + ".jpg")
DBHelper.download_thief_photo("user" + str(count) + "_" + str(3) + ".jpg")
DBHelper.download_thief_photo("user" + str(count) + "_" + str(4) + ".jpg")
DBHelper.download_thief_photo("user" + str(count) + "_" + str(5) + ".jpg")
DBHelper.download_thief_photo("user" + str(count) + "_" + str(6) + ".jpg")
DBHelper.download_thief_photo("user" + str(count) + "_" + str(7) + ".jpg")
except:
return 0
start()