2020-11-07 02:59:40 +00:00
|
|
|
import DBHelper
|
2020-11-14 17:28:50 +00:00
|
|
|
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
|
|
|
|
count = 0
|
|
|
|
users = DBHelper.db.child("Users").get()
|
|
|
|
try:
|
|
|
|
for user in users.each():
|
|
|
|
count += 1
|
2020-11-14 17:28:50 +00:00
|
|
|
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:
|
2020-11-14 17:39:20 +00:00
|
|
|
DBHelper.upload_data("user_1", firstname, lastname, email, phone, address)
|
2020-11-14 17:28:50 +00:00
|
|
|
Facial_Recognition_Registration.register_your_face("user_1")
|
|
|
|
for x in range(20):
|
|
|
|
DBHelper.upload_user_photo("user_1/" + str(x) + ".jpg")
|