Added Face Enrollment to Remove_Face and CheckUp

This commit is contained in:
Batuhan Berk Başoğlu 2021-02-15 12:27:35 -05:00
parent bc15a21be3
commit 831792b3fa
9 changed files with 12 additions and 2 deletions

View file

@ -3,6 +3,8 @@ import DBHelper
from joblib import Parallel, delayed from joblib import Parallel, delayed
import multiprocessing import multiprocessing
import Facial_Recognition_Enrollment
def update(): def update():
# Downloads all the user and thief photos from database to the project folder first or updates them. # Downloads all the user and thief photos from database to the project folder first or updates them.
@ -17,7 +19,7 @@ def update():
os.makedirs("Facial_images/face_rec/train/User_" + str(count)) os.makedirs("Facial_images/face_rec/train/User_" + str(count))
Parallel(n_jobs=multiprocessing.cpu_count())( Parallel(n_jobs=multiprocessing.cpu_count())(
delayed(download_parallel_user_photos)(i, count) for i in range(50)) delayed(download_parallel_user_photos)(i, count) for i in range(50))
print("Success.") print("User data is found.")
except: except:
print("No Users are registered.") print("No Users are registered.")
count = 0 count = 0
@ -29,9 +31,12 @@ def update():
os.makedirs("Photos_of_Thieves/Thief_" + str(count)) os.makedirs("Photos_of_Thieves/Thief_" + str(count))
Parallel(n_jobs=multiprocessing.cpu_count())( Parallel(n_jobs=multiprocessing.cpu_count())(
delayed(download_parallel_thief_photos)(i, count) for i in range(50)) delayed(download_parallel_thief_photos)(i, count) for i in range(50))
print("Success.") print("Thief data is found.")
except: except:
print("No Thieves are registered.") print("No Thieves are registered.")
print("Data saved! Starting enrollment...")
Facial_Recognition_Enrollment.enroll_face_dataset()
print("Success.")
if __name__ == "__main__": if __name__ == "__main__":

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Binary file not shown.

View file

@ -4,6 +4,8 @@ from joblib import Parallel, delayed
import multiprocessing import multiprocessing
import os import os
import Facial_Recognition_Enrollment
def remove_your_face(firstname, lastname, email, phone): def remove_your_face(firstname, lastname, email, phone):
users = DBHelper.db.child("Users").get() users = DBHelper.db.child("Users").get()
@ -49,6 +51,9 @@ def remove_your_face(firstname, lastname, email, phone):
DBHelper.get_phone("User_" + str(count2 + 1))) DBHelper.get_phone("User_" + str(count2 + 1)))
DBHelper.remove_data("User_" + str(count)) DBHelper.remove_data("User_" + str(count))
shutil.rmtree("Facial_images/face_rec/train/User_" + str(count)) shutil.rmtree("Facial_images/face_rec/train/User_" + str(count))
print("Data saved! Starting enrollment...")
Facial_Recognition_Enrollment.enroll_face_dataset()
print("Face removal completed!")
print("Success.") print("Success.")
except: except:
print("No Users exist for User Removal.") print("No Users exist for User Removal.")

Binary file not shown.

Binary file not shown.