diff --git a/Facial_Recognition_Enrollment.py b/Facial_Recognition_Enrollment.py index 126030380..e50c01540 100644 --- a/Facial_Recognition_Enrollment.py +++ b/Facial_Recognition_Enrollment.py @@ -73,3 +73,7 @@ def enroll_face_dataset(): np.save(pwd + '/Facial_models/descriptors.npy', faceDescriptors) with open(pwd + '/Facial_models/index.pkl', 'wb') as f: cPickle.dump(index, f) + + +if __name__ == "__main__": + enroll_face_dataset() diff --git a/Facial_Recognition_Inference.py b/Facial_Recognition_Inference.py index 78615670a..c4f2a7e8d 100644 --- a/Facial_Recognition_Inference.py +++ b/Facial_Recognition_Inference.py @@ -4,7 +4,6 @@ import cv2 import numpy as np import DBHelper - def inference(): try: import cPickle # Python 2 @@ -103,6 +102,5 @@ def inference(): DBHelper.set_motor("off") cv2.destroyAllWindows() - if __name__ == "__main__": - inference() + inference() \ No newline at end of file diff --git a/Facial_Recognition_Registration.py b/Facial_Recognition_Registration.py index 7bde7603d..d2872016d 100644 --- a/Facial_Recognition_Registration.py +++ b/Facial_Recognition_Registration.py @@ -15,7 +15,7 @@ def register_your_face(label): if not folder: os.makedirs(path) - cap = cv2.VideoCapture(1) + cap = cv2.VideoCapture(0) c = 0 while c < num_cap: ret, frame = cap.read() diff --git a/Facial_images/face_rec/train/User_1/0.jpg b/Facial_images/face_rec/train/User_1/0.jpg index a900455b9..79016d11f 100644 Binary files a/Facial_images/face_rec/train/User_1/0.jpg and b/Facial_images/face_rec/train/User_1/0.jpg differ diff --git a/Facial_images/face_rec/train/User_1/1.jpg b/Facial_images/face_rec/train/User_1/1.jpg index a31c11cd1..b83310775 100644 Binary files a/Facial_images/face_rec/train/User_1/1.jpg and b/Facial_images/face_rec/train/User_1/1.jpg differ diff --git a/Facial_images/face_rec/train/User_1/10.jpg b/Facial_images/face_rec/train/User_1/10.jpg index 560964b05..1dcfa0463 100644 Binary files a/Facial_images/face_rec/train/User_1/10.jpg and b/Facial_images/face_rec/train/User_1/10.jpg differ diff --git a/Facial_images/face_rec/train/User_1/11.jpg b/Facial_images/face_rec/train/User_1/11.jpg index dd3056bd6..bae7468a4 100644 Binary files a/Facial_images/face_rec/train/User_1/11.jpg and b/Facial_images/face_rec/train/User_1/11.jpg differ diff --git a/Facial_images/face_rec/train/User_1/12.jpg b/Facial_images/face_rec/train/User_1/12.jpg index b98ac89f2..1b158d22d 100644 Binary files a/Facial_images/face_rec/train/User_1/12.jpg and b/Facial_images/face_rec/train/User_1/12.jpg differ diff --git a/Facial_images/face_rec/train/User_1/13.jpg b/Facial_images/face_rec/train/User_1/13.jpg index 482d16f41..8a922dfb8 100644 Binary files a/Facial_images/face_rec/train/User_1/13.jpg and b/Facial_images/face_rec/train/User_1/13.jpg differ diff --git a/Facial_images/face_rec/train/User_1/14.jpg b/Facial_images/face_rec/train/User_1/14.jpg index bdbf9ae66..8701d8e96 100644 Binary files a/Facial_images/face_rec/train/User_1/14.jpg and b/Facial_images/face_rec/train/User_1/14.jpg differ diff --git a/Facial_images/face_rec/train/User_1/15.jpg b/Facial_images/face_rec/train/User_1/15.jpg index db30962f8..390538706 100644 Binary files a/Facial_images/face_rec/train/User_1/15.jpg and b/Facial_images/face_rec/train/User_1/15.jpg differ diff --git a/Facial_images/face_rec/train/User_1/16.jpg b/Facial_images/face_rec/train/User_1/16.jpg index 6286f69e9..84e5a53d0 100644 Binary files a/Facial_images/face_rec/train/User_1/16.jpg and b/Facial_images/face_rec/train/User_1/16.jpg differ diff --git a/Facial_images/face_rec/train/User_1/17.jpg b/Facial_images/face_rec/train/User_1/17.jpg index 539f30aa2..3f8605e29 100644 Binary files a/Facial_images/face_rec/train/User_1/17.jpg and b/Facial_images/face_rec/train/User_1/17.jpg differ diff --git a/Facial_images/face_rec/train/User_1/18.jpg b/Facial_images/face_rec/train/User_1/18.jpg index 9025b737c..dbcdabeed 100644 Binary files a/Facial_images/face_rec/train/User_1/18.jpg and b/Facial_images/face_rec/train/User_1/18.jpg differ diff --git a/Facial_images/face_rec/train/User_1/19.jpg b/Facial_images/face_rec/train/User_1/19.jpg index f189c87e9..7a86099e2 100644 Binary files a/Facial_images/face_rec/train/User_1/19.jpg and b/Facial_images/face_rec/train/User_1/19.jpg differ diff --git a/Facial_images/face_rec/train/User_1/2.jpg b/Facial_images/face_rec/train/User_1/2.jpg index a4326d4a4..200e259b6 100644 Binary files a/Facial_images/face_rec/train/User_1/2.jpg and b/Facial_images/face_rec/train/User_1/2.jpg differ diff --git a/Facial_images/face_rec/train/User_1/20.jpg b/Facial_images/face_rec/train/User_1/20.jpg index 5d30cd4c6..e3c10e9c8 100644 Binary files a/Facial_images/face_rec/train/User_1/20.jpg and b/Facial_images/face_rec/train/User_1/20.jpg differ diff --git a/Facial_images/face_rec/train/User_1/21.jpg b/Facial_images/face_rec/train/User_1/21.jpg index ae9b77950..7c167eb2a 100644 Binary files a/Facial_images/face_rec/train/User_1/21.jpg and b/Facial_images/face_rec/train/User_1/21.jpg differ diff --git a/Facial_images/face_rec/train/User_1/22.jpg b/Facial_images/face_rec/train/User_1/22.jpg index 6009dd72f..8f2d660fb 100644 Binary files a/Facial_images/face_rec/train/User_1/22.jpg and b/Facial_images/face_rec/train/User_1/22.jpg differ diff --git a/Facial_images/face_rec/train/User_1/23.jpg b/Facial_images/face_rec/train/User_1/23.jpg index a9b4892ca..9ee140478 100644 Binary files a/Facial_images/face_rec/train/User_1/23.jpg and b/Facial_images/face_rec/train/User_1/23.jpg differ diff --git a/Facial_images/face_rec/train/User_1/24.jpg b/Facial_images/face_rec/train/User_1/24.jpg index e03045845..9ed0fc6b1 100644 Binary files a/Facial_images/face_rec/train/User_1/24.jpg and b/Facial_images/face_rec/train/User_1/24.jpg differ diff --git a/Facial_images/face_rec/train/User_1/25.jpg b/Facial_images/face_rec/train/User_1/25.jpg index 74a4769a3..5bcb7c25b 100644 Binary files a/Facial_images/face_rec/train/User_1/25.jpg and b/Facial_images/face_rec/train/User_1/25.jpg differ diff --git a/Facial_images/face_rec/train/User_1/26.jpg b/Facial_images/face_rec/train/User_1/26.jpg index 6c14d3c3d..736bc89a4 100644 Binary files a/Facial_images/face_rec/train/User_1/26.jpg and b/Facial_images/face_rec/train/User_1/26.jpg differ diff --git a/Facial_images/face_rec/train/User_1/27.jpg b/Facial_images/face_rec/train/User_1/27.jpg index 74b92b59f..c2f95929e 100644 Binary files a/Facial_images/face_rec/train/User_1/27.jpg and b/Facial_images/face_rec/train/User_1/27.jpg differ diff --git a/Facial_images/face_rec/train/User_1/28.jpg b/Facial_images/face_rec/train/User_1/28.jpg index e4d4ab9f1..fed9f8f95 100644 Binary files a/Facial_images/face_rec/train/User_1/28.jpg and b/Facial_images/face_rec/train/User_1/28.jpg differ diff --git a/Facial_images/face_rec/train/User_1/29.jpg b/Facial_images/face_rec/train/User_1/29.jpg index 32fea6e51..cfc71d4de 100644 Binary files a/Facial_images/face_rec/train/User_1/29.jpg and b/Facial_images/face_rec/train/User_1/29.jpg differ diff --git a/Facial_images/face_rec/train/User_1/3.jpg b/Facial_images/face_rec/train/User_1/3.jpg index 8e486e7d9..8f1cd3dbf 100644 Binary files a/Facial_images/face_rec/train/User_1/3.jpg and b/Facial_images/face_rec/train/User_1/3.jpg differ diff --git a/Facial_images/face_rec/train/User_1/30.jpg b/Facial_images/face_rec/train/User_1/30.jpg index 79f10c6aa..be1c3cf65 100644 Binary files a/Facial_images/face_rec/train/User_1/30.jpg and b/Facial_images/face_rec/train/User_1/30.jpg differ diff --git a/Facial_images/face_rec/train/User_1/31.jpg b/Facial_images/face_rec/train/User_1/31.jpg index 9c22f85ea..d255a1df4 100644 Binary files a/Facial_images/face_rec/train/User_1/31.jpg and b/Facial_images/face_rec/train/User_1/31.jpg differ diff --git a/Facial_images/face_rec/train/User_1/32.jpg b/Facial_images/face_rec/train/User_1/32.jpg index fa74b41ca..d5dcbf09f 100644 Binary files a/Facial_images/face_rec/train/User_1/32.jpg and b/Facial_images/face_rec/train/User_1/32.jpg differ diff --git a/Facial_images/face_rec/train/User_1/33.jpg b/Facial_images/face_rec/train/User_1/33.jpg index deba2b3e2..4d5557a71 100644 Binary files a/Facial_images/face_rec/train/User_1/33.jpg and b/Facial_images/face_rec/train/User_1/33.jpg differ diff --git a/Facial_images/face_rec/train/User_1/34.jpg b/Facial_images/face_rec/train/User_1/34.jpg index 61feaccaa..08d36de78 100644 Binary files a/Facial_images/face_rec/train/User_1/34.jpg and b/Facial_images/face_rec/train/User_1/34.jpg differ diff --git a/Facial_images/face_rec/train/User_1/35.jpg b/Facial_images/face_rec/train/User_1/35.jpg index 0315c495e..0b938aac7 100644 Binary files a/Facial_images/face_rec/train/User_1/35.jpg and b/Facial_images/face_rec/train/User_1/35.jpg differ diff --git a/Facial_images/face_rec/train/User_1/36.jpg b/Facial_images/face_rec/train/User_1/36.jpg index f160afbe4..c710d7902 100644 Binary files a/Facial_images/face_rec/train/User_1/36.jpg and b/Facial_images/face_rec/train/User_1/36.jpg differ diff --git a/Facial_images/face_rec/train/User_1/37.jpg b/Facial_images/face_rec/train/User_1/37.jpg index 4d1440215..16c1e394a 100644 Binary files a/Facial_images/face_rec/train/User_1/37.jpg and b/Facial_images/face_rec/train/User_1/37.jpg differ diff --git a/Facial_images/face_rec/train/User_1/38.jpg b/Facial_images/face_rec/train/User_1/38.jpg index b97ded121..1388b4d65 100644 Binary files a/Facial_images/face_rec/train/User_1/38.jpg and b/Facial_images/face_rec/train/User_1/38.jpg differ diff --git a/Facial_images/face_rec/train/User_1/39.jpg b/Facial_images/face_rec/train/User_1/39.jpg index 63098e154..5545d430f 100644 Binary files a/Facial_images/face_rec/train/User_1/39.jpg and b/Facial_images/face_rec/train/User_1/39.jpg differ diff --git a/Facial_images/face_rec/train/User_1/4.jpg b/Facial_images/face_rec/train/User_1/4.jpg index 965c1ffc9..d8840ec1f 100644 Binary files a/Facial_images/face_rec/train/User_1/4.jpg and b/Facial_images/face_rec/train/User_1/4.jpg differ diff --git a/Facial_images/face_rec/train/User_1/40.jpg b/Facial_images/face_rec/train/User_1/40.jpg index d8cd0f6ae..c782d5b5d 100644 Binary files a/Facial_images/face_rec/train/User_1/40.jpg and b/Facial_images/face_rec/train/User_1/40.jpg differ diff --git a/Facial_images/face_rec/train/User_1/41.jpg b/Facial_images/face_rec/train/User_1/41.jpg index 514236b8f..c6ec5dfd1 100644 Binary files a/Facial_images/face_rec/train/User_1/41.jpg and b/Facial_images/face_rec/train/User_1/41.jpg differ diff --git a/Facial_images/face_rec/train/User_1/42.jpg b/Facial_images/face_rec/train/User_1/42.jpg index e51007c0d..99da175d0 100644 Binary files a/Facial_images/face_rec/train/User_1/42.jpg and b/Facial_images/face_rec/train/User_1/42.jpg differ diff --git a/Facial_images/face_rec/train/User_1/43.jpg b/Facial_images/face_rec/train/User_1/43.jpg index 3aed7023a..b04860585 100644 Binary files a/Facial_images/face_rec/train/User_1/43.jpg and b/Facial_images/face_rec/train/User_1/43.jpg differ diff --git a/Facial_images/face_rec/train/User_1/44.jpg b/Facial_images/face_rec/train/User_1/44.jpg index dab746428..d2bf71550 100644 Binary files a/Facial_images/face_rec/train/User_1/44.jpg and b/Facial_images/face_rec/train/User_1/44.jpg differ diff --git a/Facial_images/face_rec/train/User_1/45.jpg b/Facial_images/face_rec/train/User_1/45.jpg index bce009d5f..67d725b72 100644 Binary files a/Facial_images/face_rec/train/User_1/45.jpg and b/Facial_images/face_rec/train/User_1/45.jpg differ diff --git a/Facial_images/face_rec/train/User_1/46.jpg b/Facial_images/face_rec/train/User_1/46.jpg index 65a934e5f..bb7e2f7c4 100644 Binary files a/Facial_images/face_rec/train/User_1/46.jpg and b/Facial_images/face_rec/train/User_1/46.jpg differ diff --git a/Facial_images/face_rec/train/User_1/47.jpg b/Facial_images/face_rec/train/User_1/47.jpg index b470c657b..6eef48313 100644 Binary files a/Facial_images/face_rec/train/User_1/47.jpg and b/Facial_images/face_rec/train/User_1/47.jpg differ diff --git a/Facial_images/face_rec/train/User_1/48.jpg b/Facial_images/face_rec/train/User_1/48.jpg index 0b8bffc39..71fe221a5 100644 Binary files a/Facial_images/face_rec/train/User_1/48.jpg and b/Facial_images/face_rec/train/User_1/48.jpg differ diff --git a/Facial_images/face_rec/train/User_1/49.jpg b/Facial_images/face_rec/train/User_1/49.jpg index 73bdc01ea..0a2a184f1 100644 Binary files a/Facial_images/face_rec/train/User_1/49.jpg and b/Facial_images/face_rec/train/User_1/49.jpg differ diff --git a/Facial_images/face_rec/train/User_1/5.jpg b/Facial_images/face_rec/train/User_1/5.jpg index 146564ebd..2e44859af 100644 Binary files a/Facial_images/face_rec/train/User_1/5.jpg and b/Facial_images/face_rec/train/User_1/5.jpg differ diff --git a/Facial_images/face_rec/train/User_1/6.jpg b/Facial_images/face_rec/train/User_1/6.jpg index 063377993..a388c2916 100644 Binary files a/Facial_images/face_rec/train/User_1/6.jpg and b/Facial_images/face_rec/train/User_1/6.jpg differ diff --git a/Facial_images/face_rec/train/User_1/7.jpg b/Facial_images/face_rec/train/User_1/7.jpg index 9a891b421..33821b320 100644 Binary files a/Facial_images/face_rec/train/User_1/7.jpg and b/Facial_images/face_rec/train/User_1/7.jpg differ diff --git a/Facial_images/face_rec/train/User_1/8.jpg b/Facial_images/face_rec/train/User_1/8.jpg index 3846dff25..9c63cbfca 100644 Binary files a/Facial_images/face_rec/train/User_1/8.jpg and b/Facial_images/face_rec/train/User_1/8.jpg differ diff --git a/Facial_images/face_rec/train/User_1/9.jpg b/Facial_images/face_rec/train/User_1/9.jpg index 679584654..0ed70a312 100644 Binary files a/Facial_images/face_rec/train/User_1/9.jpg and b/Facial_images/face_rec/train/User_1/9.jpg differ diff --git a/Facial_models/descriptors.npy b/Facial_models/descriptors.npy index ddd6938f4..8c0c7b380 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 43db0a49c..f0808a449 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 1ac68f96a..c670385ba 100644 --- a/Upload_Face.py +++ b/Upload_Face.py @@ -13,8 +13,11 @@ def upload_your_face(firstname, lastname, email, phone): for user in users.each(): count += 1 DBHelper.upload_data("User_" + str(count), firstname, lastname, email, phone) + print("Face registration start...") Facial_Recognition_Registration.register_your_face("User_" + str(count)) + print("Data saved! Starting enrollment...") Facial_Recognition_Enrollment.enroll_face_dataset() + print("Face registration completed!") for i in range(20): DBHelper.upload_user_photo("User_" + str(count) + "/" + str(i) + ".jpg") except: diff --git a/__pycache__/Facial_Recognition_Registration.cpython-36.pyc b/__pycache__/Facial_Recognition_Registration.cpython-36.pyc index e0451523e..b281b0028 100644 Binary files a/__pycache__/Facial_Recognition_Registration.cpython-36.pyc and b/__pycache__/Facial_Recognition_Registration.cpython-36.pyc differ