diff --git a/Facial_images/face_rec/train/User_3/0.jpg b/Facial_images/face_rec/train/User_3/0.jpg new file mode 100644 index 000000000..e6e4f2d5c Binary files /dev/null and b/Facial_images/face_rec/train/User_3/0.jpg differ diff --git a/Facial_images/face_rec/train/User_3/1.jpg b/Facial_images/face_rec/train/User_3/1.jpg new file mode 100644 index 000000000..20fe7df79 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/1.jpg differ diff --git a/Facial_images/face_rec/train/User_3/10.jpg b/Facial_images/face_rec/train/User_3/10.jpg new file mode 100644 index 000000000..08b4d9253 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/10.jpg differ diff --git a/Facial_images/face_rec/train/User_3/11.jpg b/Facial_images/face_rec/train/User_3/11.jpg new file mode 100644 index 000000000..09efe626f Binary files /dev/null and b/Facial_images/face_rec/train/User_3/11.jpg differ diff --git a/Facial_images/face_rec/train/User_3/12.jpg b/Facial_images/face_rec/train/User_3/12.jpg new file mode 100644 index 000000000..fa2d88f37 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/12.jpg differ diff --git a/Facial_images/face_rec/train/User_3/13.jpg b/Facial_images/face_rec/train/User_3/13.jpg new file mode 100644 index 000000000..2e4e089c4 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/13.jpg differ diff --git a/Facial_images/face_rec/train/User_3/14.jpg b/Facial_images/face_rec/train/User_3/14.jpg new file mode 100644 index 000000000..604746120 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/14.jpg differ diff --git a/Facial_images/face_rec/train/User_3/15.jpg b/Facial_images/face_rec/train/User_3/15.jpg new file mode 100644 index 000000000..6eb431cb3 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/15.jpg differ diff --git a/Facial_images/face_rec/train/User_3/16.jpg b/Facial_images/face_rec/train/User_3/16.jpg new file mode 100644 index 000000000..17f9b2478 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/16.jpg differ diff --git a/Facial_images/face_rec/train/User_3/17.jpg b/Facial_images/face_rec/train/User_3/17.jpg new file mode 100644 index 000000000..779e38777 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/17.jpg differ diff --git a/Facial_images/face_rec/train/User_3/18.jpg b/Facial_images/face_rec/train/User_3/18.jpg new file mode 100644 index 000000000..e2661ac7a Binary files /dev/null and b/Facial_images/face_rec/train/User_3/18.jpg differ diff --git a/Facial_images/face_rec/train/User_3/19.jpg b/Facial_images/face_rec/train/User_3/19.jpg new file mode 100644 index 000000000..764e1a73f Binary files /dev/null and b/Facial_images/face_rec/train/User_3/19.jpg differ diff --git a/Facial_images/face_rec/train/User_3/2.jpg b/Facial_images/face_rec/train/User_3/2.jpg new file mode 100644 index 000000000..614eb42fb Binary files /dev/null and b/Facial_images/face_rec/train/User_3/2.jpg differ diff --git a/Facial_images/face_rec/train/User_3/20.jpg b/Facial_images/face_rec/train/User_3/20.jpg new file mode 100644 index 000000000..c0e2527ed Binary files /dev/null and b/Facial_images/face_rec/train/User_3/20.jpg differ diff --git a/Facial_images/face_rec/train/User_3/21.jpg b/Facial_images/face_rec/train/User_3/21.jpg new file mode 100644 index 000000000..735268432 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/21.jpg differ diff --git a/Facial_images/face_rec/train/User_3/22.jpg b/Facial_images/face_rec/train/User_3/22.jpg new file mode 100644 index 000000000..373721099 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/22.jpg differ diff --git a/Facial_images/face_rec/train/User_3/23.jpg b/Facial_images/face_rec/train/User_3/23.jpg new file mode 100644 index 000000000..e4f83a1d4 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/23.jpg differ diff --git a/Facial_images/face_rec/train/User_3/24.jpg b/Facial_images/face_rec/train/User_3/24.jpg new file mode 100644 index 000000000..ca89ec26b Binary files /dev/null and b/Facial_images/face_rec/train/User_3/24.jpg differ diff --git a/Facial_images/face_rec/train/User_3/25.jpg b/Facial_images/face_rec/train/User_3/25.jpg new file mode 100644 index 000000000..3a0fa8685 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/25.jpg differ diff --git a/Facial_images/face_rec/train/User_3/26.jpg b/Facial_images/face_rec/train/User_3/26.jpg new file mode 100644 index 000000000..5ac333615 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/26.jpg differ diff --git a/Facial_images/face_rec/train/User_3/27.jpg b/Facial_images/face_rec/train/User_3/27.jpg new file mode 100644 index 000000000..af05facbc Binary files /dev/null and b/Facial_images/face_rec/train/User_3/27.jpg differ diff --git a/Facial_images/face_rec/train/User_3/28.jpg b/Facial_images/face_rec/train/User_3/28.jpg new file mode 100644 index 000000000..2ddba95a0 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/28.jpg differ diff --git a/Facial_images/face_rec/train/User_3/29.jpg b/Facial_images/face_rec/train/User_3/29.jpg new file mode 100644 index 000000000..2fa959dc6 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/29.jpg differ diff --git a/Facial_images/face_rec/train/User_3/3.jpg b/Facial_images/face_rec/train/User_3/3.jpg new file mode 100644 index 000000000..bc9f89e62 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/3.jpg differ diff --git a/Facial_images/face_rec/train/User_3/30.jpg b/Facial_images/face_rec/train/User_3/30.jpg new file mode 100644 index 000000000..8d7ef4187 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/30.jpg differ diff --git a/Facial_images/face_rec/train/User_3/31.jpg b/Facial_images/face_rec/train/User_3/31.jpg new file mode 100644 index 000000000..6b7614702 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/31.jpg differ diff --git a/Facial_images/face_rec/train/User_3/32.jpg b/Facial_images/face_rec/train/User_3/32.jpg new file mode 100644 index 000000000..b90bcf4eb Binary files /dev/null and b/Facial_images/face_rec/train/User_3/32.jpg differ diff --git a/Facial_images/face_rec/train/User_3/33.jpg b/Facial_images/face_rec/train/User_3/33.jpg new file mode 100644 index 000000000..b4c19bcb7 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/33.jpg differ diff --git a/Facial_images/face_rec/train/User_3/34.jpg b/Facial_images/face_rec/train/User_3/34.jpg new file mode 100644 index 000000000..769336664 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/34.jpg differ diff --git a/Facial_images/face_rec/train/User_3/35.jpg b/Facial_images/face_rec/train/User_3/35.jpg new file mode 100644 index 000000000..c3060beb8 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/35.jpg differ diff --git a/Facial_images/face_rec/train/User_3/36.jpg b/Facial_images/face_rec/train/User_3/36.jpg new file mode 100644 index 000000000..80bf61839 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/36.jpg differ diff --git a/Facial_images/face_rec/train/User_3/37.jpg b/Facial_images/face_rec/train/User_3/37.jpg new file mode 100644 index 000000000..d64c6fbd6 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/37.jpg differ diff --git a/Facial_images/face_rec/train/User_3/38.jpg b/Facial_images/face_rec/train/User_3/38.jpg new file mode 100644 index 000000000..82e80e603 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/38.jpg differ diff --git a/Facial_images/face_rec/train/User_3/39.jpg b/Facial_images/face_rec/train/User_3/39.jpg new file mode 100644 index 000000000..f355d20ee Binary files /dev/null and b/Facial_images/face_rec/train/User_3/39.jpg differ diff --git a/Facial_images/face_rec/train/User_3/4.jpg b/Facial_images/face_rec/train/User_3/4.jpg new file mode 100644 index 000000000..efc187264 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/4.jpg differ diff --git a/Facial_images/face_rec/train/User_3/40.jpg b/Facial_images/face_rec/train/User_3/40.jpg new file mode 100644 index 000000000..dea885504 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/40.jpg differ diff --git a/Facial_images/face_rec/train/User_3/41.jpg b/Facial_images/face_rec/train/User_3/41.jpg new file mode 100644 index 000000000..703ae50b4 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/41.jpg differ diff --git a/Facial_images/face_rec/train/User_3/42.jpg b/Facial_images/face_rec/train/User_3/42.jpg new file mode 100644 index 000000000..a602c4470 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/42.jpg differ diff --git a/Facial_images/face_rec/train/User_3/43.jpg b/Facial_images/face_rec/train/User_3/43.jpg new file mode 100644 index 000000000..740ddea73 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/43.jpg differ diff --git a/Facial_images/face_rec/train/User_3/44.jpg b/Facial_images/face_rec/train/User_3/44.jpg new file mode 100644 index 000000000..a0e96d666 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/44.jpg differ diff --git a/Facial_images/face_rec/train/User_3/45.jpg b/Facial_images/face_rec/train/User_3/45.jpg new file mode 100644 index 000000000..cc393682c Binary files /dev/null and b/Facial_images/face_rec/train/User_3/45.jpg differ diff --git a/Facial_images/face_rec/train/User_3/46.jpg b/Facial_images/face_rec/train/User_3/46.jpg new file mode 100644 index 000000000..e033c838a Binary files /dev/null and b/Facial_images/face_rec/train/User_3/46.jpg differ diff --git a/Facial_images/face_rec/train/User_3/47.jpg b/Facial_images/face_rec/train/User_3/47.jpg new file mode 100644 index 000000000..01d36c000 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/47.jpg differ diff --git a/Facial_images/face_rec/train/User_3/48.jpg b/Facial_images/face_rec/train/User_3/48.jpg new file mode 100644 index 000000000..46c37dcc2 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/48.jpg differ diff --git a/Facial_images/face_rec/train/User_3/49.jpg b/Facial_images/face_rec/train/User_3/49.jpg new file mode 100644 index 000000000..35f90b254 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/49.jpg differ diff --git a/Facial_images/face_rec/train/User_3/5.jpg b/Facial_images/face_rec/train/User_3/5.jpg new file mode 100644 index 000000000..5652f3931 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/5.jpg differ diff --git a/Facial_images/face_rec/train/User_3/6.jpg b/Facial_images/face_rec/train/User_3/6.jpg new file mode 100644 index 000000000..521a8dea8 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/6.jpg differ diff --git a/Facial_images/face_rec/train/User_3/7.jpg b/Facial_images/face_rec/train/User_3/7.jpg new file mode 100644 index 000000000..6ae948d7c Binary files /dev/null and b/Facial_images/face_rec/train/User_3/7.jpg differ diff --git a/Facial_images/face_rec/train/User_3/8.jpg b/Facial_images/face_rec/train/User_3/8.jpg new file mode 100644 index 000000000..8e4fd5cd4 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/8.jpg differ diff --git a/Facial_images/face_rec/train/User_3/9.jpg b/Facial_images/face_rec/train/User_3/9.jpg new file mode 100644 index 000000000..9be261fd5 Binary files /dev/null and b/Facial_images/face_rec/train/User_3/9.jpg differ diff --git a/Facial_models/descriptors.npy b/Facial_models/descriptors.npy index f5e36fece..823186425 100644 Binary files a/Facial_models/descriptors.npy and b/Facial_models/descriptors.npy differ diff --git a/Facial_models/index.pkl b/Facial_models/index.pkl index 46ef7d5cc..f7f47c16b 100644 Binary files a/Facial_models/index.pkl and b/Facial_models/index.pkl differ diff --git a/Upload_Face.py b/Upload_Face.py index 26dfbbe60..8a13ab6b2 100644 --- a/Upload_Face.py +++ b/Upload_Face.py @@ -1,6 +1,8 @@ import DBHelper import Facial_Recognition_Registration import Facial_Recognition_Enrollment +from joblib import Parallel, delayed +import multiprocessing def upload_your_face(firstname, lastname, email, phone): @@ -15,22 +17,22 @@ def upload_your_face(firstname, lastname, email, phone): count += 1 print("Face registration start...") Facial_Recognition_Registration.register_your_face("User_" + str(count)) + Parallel(n_jobs=multiprocessing.cpu_count())( + delayed(upload_parallel_user_photos)(i, count) for i in range(50)) + DBHelper.upload_data("User_" + str(count), firstname, lastname, email, phone) print("Data saved! Starting enrollment...") Facial_Recognition_Enrollment.enroll_face_dataset() print("Face registration completed!") - for i in range(50): - DBHelper.upload_user_photo("User_" + str(count) + "/" + str(i) + ".jpg") - DBHelper.upload_data("User_" + str(count), firstname, lastname, email, phone) print("Success.") except: print("Face registration start...") Facial_Recognition_Registration.register_your_face("User_1") + Parallel(n_jobs=multiprocessing.cpu_count())( + delayed(upload_parallel_user_photo)(i) for i in range(50)) + DBHelper.upload_data("User_1", firstname, lastname, email, phone) print("Data saved! Starting enrollment...") Facial_Recognition_Enrollment.enroll_face_dataset() print("Face registration completed!") - for i in range(50): - DBHelper.upload_user_photo("User_1/" + str(i) + ".jpg") - DBHelper.upload_data("User_1", firstname, lastname, email, phone) print("Success.") @@ -40,3 +42,11 @@ if __name__ == "__main__": e = input('Enter your E-Mail:') p = input('Enter your Phone:') upload_your_face(f, l, e, p) + + +def upload_parallel_user_photos(i, count): + DBHelper.upload_user_photo("User_" + str(count) + "/" + str(i) + ".jpg") + + +def upload_parallel_user_photo(i): + DBHelper.upload_user_photo("User_1/" + str(i) + ".jpg") \ No newline at end of file diff --git a/Upload_Thief.py b/Upload_Thief.py index 30780857d..a5f429a50 100644 --- a/Upload_Thief.py +++ b/Upload_Thief.py @@ -1,6 +1,8 @@ import DBHelper import Facial_Recognition_Thief_Registration from datetime import datetime +from joblib import Parallel, delayed +import multiprocessing def upload_thief_face(): @@ -13,16 +15,16 @@ def upload_thief_face(): for thief in thieves.each(): count += 1 Facial_Recognition_Thief_Registration.register_your_face("Thief_" + str(count)) - for i in range(50): - DBHelper.upload_thief_photo("Thief_" + str(count) + "/" + str(i) + ".jpg") + Parallel(n_jobs=multiprocessing.cpu_count())( + delayed(upload_parallel_thief_photos)(i, count) for i in range(50)) date = datetime.now().strftime("%d/%m/%Y") time = datetime.now().strftime("%H:%M:%S") DBHelper.upload_thief_data("Thief_" + str(count), date, time) print("An intruder is recorded.") except: Facial_Recognition_Thief_Registration.register_your_face("Thief_1") - for i in range(50): - DBHelper.upload_thief_photo("Thief_1/" + str(i) + ".jpg") + Parallel(n_jobs=multiprocessing.cpu_count())( + delayed(upload_parallel_thief_photo)(i) for i in range(50)) date = datetime.now().strftime("%d/%m/%Y") time = datetime.now().strftime("%H:%M:%S") DBHelper.upload_thief_data("Thief_1", date, time) @@ -31,3 +33,11 @@ def upload_thief_face(): if __name__ == "__main__": upload_thief_face() + + +def upload_parallel_thief_photos(i, count): + DBHelper.upload_thief_photo("Thief_" + str(count) + "/" + str(i) + ".jpg") + + +def upload_parallel_thief_photo(i): + DBHelper.upload_thief_photo("Thief_1/" + str(i) + ".jpg") diff --git a/__pycache__/Check_Up.cpython-36.pyc b/__pycache__/Check_Up.cpython-36.pyc index 14764f192..34bb6ae2d 100644 Binary files a/__pycache__/Check_Up.cpython-36.pyc and b/__pycache__/Check_Up.cpython-36.pyc differ diff --git a/__pycache__/DBHelper.cpython-36.pyc b/__pycache__/DBHelper.cpython-36.pyc index 844a8e7af..ab62e13f0 100644 Binary files a/__pycache__/DBHelper.cpython-36.pyc and b/__pycache__/DBHelper.cpython-36.pyc differ diff --git a/__pycache__/Remove_Face.cpython-36.pyc b/__pycache__/Remove_Face.cpython-36.pyc index 39dd9c496..b9ed041c9 100644 Binary files a/__pycache__/Remove_Face.cpython-36.pyc and b/__pycache__/Remove_Face.cpython-36.pyc differ diff --git a/__pycache__/Start_Engine.cpython-36.pyc b/__pycache__/Start_Engine.cpython-36.pyc index daeb91075..a79bc90fd 100644 Binary files a/__pycache__/Start_Engine.cpython-36.pyc and b/__pycache__/Start_Engine.cpython-36.pyc differ diff --git a/__pycache__/Upload_Face.cpython-36.pyc b/__pycache__/Upload_Face.cpython-36.pyc index a1538623d..ec887acb2 100644 Binary files a/__pycache__/Upload_Face.cpython-36.pyc and b/__pycache__/Upload_Face.cpython-36.pyc differ diff --git a/__pycache__/Upload_Thief.cpython-36.pyc b/__pycache__/Upload_Thief.cpython-36.pyc index 42239d728..aaa0b2345 100644 Binary files a/__pycache__/Upload_Thief.cpython-36.pyc and b/__pycache__/Upload_Thief.cpython-36.pyc differ diff --git a/start_engine.py b/start_engine.py index e34164a39..9da61f0d0 100644 --- a/start_engine.py +++ b/start_engine.py @@ -9,7 +9,7 @@ def start(): for user in users.each(): count += 1 if count != 0: - print("Starting the Face Recognition Software...") + print("Initializing the Face Recognition Software...") Facial_Recognition_Inference.inference() else: print("No Users exist for Facial Recognition Software.")