Updated Start_Engine and Upload_Face

This commit is contained in:
Batuhan Berk Başoğlu 2020-11-06 22:57:24 -05:00
parent 75aa1d51dc
commit 574f4c798e
7 changed files with 48 additions and 3 deletions

View file

@ -126,4 +126,4 @@ def delete_user_photo(user_photo):
# Deletes photo of the specified thief. # Deletes photo of the specified thief.
def delete_thief_photo(user_photo): def delete_thief_photo(user_photo):
storage.delete('Photos_of_Thieves/' + user_photo) storage.delete('Photos_of_Thieves/' + user_photo)

View file

@ -1,6 +1,17 @@
import DBHelper import DBHelper
import Facial_Recognition_Software import Facial_Recognition_Software
import midterm_demo_HARDWARE
def upload_your_face(ID, firstname, lastname, email, phone, address): 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
DBHelper.upload_data(count, firstname, lastname, email, phone, address)
except:
DBHelper.upload_data("1", firstname, lastname, email, phone, address)

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,2 +1,36 @@
import DBHelper
import Facial_Recognition_Software
def start(): def start():
# 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()