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
# 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):
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):
storage.child("Photos_of_Thieves/" + thief_id).put("Facial_images/face_rec/train/" + thief_id)
# Downloads the specified user photo.
def download_user_photo(user_photo):
storage.child("Photos_of_Users/" + str(user_photo)).download("Users_from_Database/" + str(user_photo))
# Downloads the specified user's photos, input should be something like "example.jpg"
def download_user_photo(user_id):
storage.child("Photos_of_Users/" + user_id).download("Facial_images/face_rec/train/" + user_id)
# Downloads the specified thief photo.
def download_thief_photo(user_photo):
storage.child("Photos_of_Thieves/" + str(user_photo)).download("Thieves_from_Database/" + str(user_photo))
# Downloads the specified thief's photos, input should be something like "example.jpg"
def download_thief_photo(thief_id):
storage.child("Photos_of_Thieves/" + thief_id).download("Photos_of_Thieves/" + thief_id)
# 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):
# 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.
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))
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")
DBHelper.upload_user_photo("User_" + str(count) + "/" + str(x) + ".jpg")
except:
DBHelper.upload_data("user_1", firstname, lastname, email, phone, address)
Facial_Recognition_Registration.register_your_face("user_1")
DBHelper.upload_data("User_1", firstname, lastname, email, phone, address)
Facial_Recognition_Registration.register_your_face("User_1")
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 Facial_Recognition_Software
import Facial_Recognition_Wrapper
def start():
@ -9,28 +10,22 @@ def start():
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")
for x in range(20):
if not os.path.isdir("Facial_images/face_rec/train/User_" + str(count)):
os.makedirs("Photos_of_Users/User_" + str(count))
DBHelper.download_user_photo("User_" + str(count) + "/" + str(x) + ".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")
for x in range(20):
if not os.path.isdir("Photos_of_Thieves/Thief_" + str(count)):
os.makedirs("Photos_of_Thieves/Thief_" + str(count))
DBHelper.download_thief_photo("Thief_" + str(count) + "/" + str(x) + ".jpg")
except:
return 0
print("No Thieves for now.")
Facial_Recognition_Wrapper.training_recognizer("Fisher")
Facial_Recognition_Wrapper.face_recognition_inference("Fisher")
start()