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

31 lines
1.3 KiB
Python
Raw Normal View History

2020-11-07 02:59:40 +00:00
import DBHelper
import Facial_Recognition_Registration
2020-11-07 02:59:40 +00:00
2020-11-07 03:57:24 +00:00
def upload_your_face(firstname, lastname, email, phone, address):
# Determines user ID before adding the data to the database.
# User ID is determined from number of user dataset in database
# Later on it starts face recognition system and uploads it into the database based on the given user ID.
2020-11-07 03:57:24 +00:00
count = 0
users = DBHelper.db.child("Users").get()
try:
for user in users.each():
count += 1
DBHelper.upload_data("User_" + str(count), firstname, lastname, email, phone, address)
Facial_Recognition_Registration.register_your_face("User_" + str(count))
for x in range(20):
DBHelper.upload_user_photo("User_" + str(count) + "/" + str(x) + ".jpg")
2020-11-07 03:57:24 +00:00
except:
DBHelper.upload_data("User_1", firstname, lastname, email, phone, address)
Facial_Recognition_Registration.register_your_face("User_1")
for x in range(20):
2020-11-18 02:56:47 +00:00
DBHelper.upload_user_photo("User_1/" + str(x) + ".jpg")
if __name__ == "__main__":
f = input('Enter your First Name:')
l = input('Enter your Last Name:')
e = input('Enter your E-Mail:')
p = input('Enter your Phone:')
a = input('Enter your Address:')
upload_your_face(f, l, e, p, a)