Fully integrated DB to Facial Recognition Software.

This commit is contained in:
Batuhan Berk Başoğlu 2020-11-14 15:25:24 -05:00
parent de525f0bff
commit c5bf048621
70 changed files with 102468 additions and 102472 deletions

View file

@ -99,24 +99,24 @@ def get_address(user_id):
return address return address
# Uploads the photo of user, input should be something like "example.png" # Uploads the photos of user, input should be something like "example.jpg"
def upload_user_photo(user_id): def upload_user_photo(user_id):
storage.child("Photos_of_Users/" + user_id).put("Facial_images/face_rec/train/" + user_id) storage.child("Photos_of_Users/" + user_id).put("Facial_images/face_rec/train/" + user_id)
# Uploads the photo of thief, input should be something like "example.png" # Uploads the photos of thief, input should be something like "example.jpg"
def upload_thief_photo(thief_id): def upload_thief_photo(thief_id):
storage.child("Photos_of_Thieves/" + thief_id).put("Facial_images/face_rec/train/" + thief_id) storage.child("Photos_of_Thieves/" + thief_id).put("Facial_images/face_rec/train/" + thief_id)
# Downloads the specified user photo. # Downloads the specified user's photos, input should be something like "example.jpg"
def download_user_photo(user_photo): def download_user_photo(user_id):
storage.child("Photos_of_Users/" + str(user_photo)).download("Users_from_Database/" + str(user_photo)) storage.child("Photos_of_Users/" + user_id).download("Facial_images/face_rec/train/" + user_id)
# Downloads the specified thief photo. # Downloads the specified thief's photos, input should be something like "example.jpg"
def download_thief_photo(user_photo): def download_thief_photo(thief_id):
storage.child("Photos_of_Thieves/" + str(user_photo)).download("Thieves_from_Database/" + str(user_photo)) storage.child("Photos_of_Thieves/" + thief_id).download("Photos_of_Thieves/" + thief_id)
# Deletes photo of the specified user. # Deletes photo of the specified user.

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View file

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

@ -5,17 +5,18 @@ import Facial_Recognition_Registration
def upload_your_face(firstname, lastname, email, phone, address): def upload_your_face(firstname, lastname, email, phone, address):
# Determines user ID before adding the data to the database. # Determines user ID before adding the data to the database.
# User ID is determined from number of user dataset in 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.
count = 0 count = 0
users = DBHelper.db.child("Users").get() users = DBHelper.db.child("Users").get()
try: try:
for user in users.each(): for user in users.each():
count += 1 count += 1
DBHelper.upload_data("user_" + str(count), firstname, lastname, email, phone, address) DBHelper.upload_data("User_" + str(count), firstname, lastname, email, phone, address)
Facial_Recognition_Registration.register_your_face("user_" + str(count)) Facial_Recognition_Registration.register_your_face("User_" + str(count))
for x in range(20): for x in range(20):
DBHelper.upload_user_photo("user_" + str(count) + "/" + str(x) + ".jpg") DBHelper.upload_user_photo("User_" + str(count) + "/" + str(x) + ".jpg")
except: except:
DBHelper.upload_data("user_1", firstname, lastname, email, phone, address) DBHelper.upload_data("User_1", firstname, lastname, email, phone, address)
Facial_Recognition_Registration.register_your_face("user_1") Facial_Recognition_Registration.register_your_face("User_1")
for x in range(20): for x in range(20):
DBHelper.upload_user_photo("user_1/" + str(x) + ".jpg") DBHelper.upload_user_photo("User_1/" + str(x) + ".jpg")

Binary file not shown.

Binary file not shown.

View file

@ -1,5 +1,6 @@
import os
import DBHelper import DBHelper
import Facial_Recognition_Software import Facial_Recognition_Wrapper
def start(): def start():
@ -9,28 +10,22 @@ def start():
try: try:
for user in users.each(): for user in users.each():
count = +1 count = +1
DBHelper.download_user_photo("user" + str(count) + "_" + str(1) + ".jpg") for x in range(20):
DBHelper.download_user_photo("user" + str(count) + "_" + str(2) + ".jpg") if not os.path.isdir("Facial_images/face_rec/train/User_" + str(count)):
DBHelper.download_user_photo("user" + str(count) + "_" + str(3) + ".jpg") os.makedirs("Photos_of_Users/User_" + str(count))
DBHelper.download_user_photo("user" + str(count) + "_" + str(4) + ".jpg") DBHelper.download_user_photo("User_" + str(count) + "/" + str(x) + ".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: except:
print("No Users are registered.") print("No Users are registered.")
count = 0 count = 0
try: try:
for user in users.each(): for user in users.each():
count = +1 count = +1
DBHelper.download_thief_photo("user" + str(count) + "_" + str(1) + ".jpg") for x in range(20):
DBHelper.download_thief_photo("user" + str(count) + "_" + str(2) + ".jpg") if not os.path.isdir("Photos_of_Thieves/Thief_" + str(count)):
DBHelper.download_thief_photo("user" + str(count) + "_" + str(3) + ".jpg") os.makedirs("Photos_of_Thieves/Thief_" + str(count))
DBHelper.download_thief_photo("user" + str(count) + "_" + str(4) + ".jpg") DBHelper.download_thief_photo("Thief_" + str(count) + "/" + str(x) + ".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: except:
return 0 print("No Thieves for now.")
Facial_Recognition_Wrapper.training_recognizer("Fisher")
Facial_Recognition_Wrapper.face_recognition_inference("Fisher")
start()