Updated Upload_Face.
|
@ -73,3 +73,7 @@ def enroll_face_dataset():
|
||||||
np.save(pwd + '/Facial_models/descriptors.npy', faceDescriptors)
|
np.save(pwd + '/Facial_models/descriptors.npy', faceDescriptors)
|
||||||
with open(pwd + '/Facial_models/index.pkl', 'wb') as f:
|
with open(pwd + '/Facial_models/index.pkl', 'wb') as f:
|
||||||
cPickle.dump(index, f)
|
cPickle.dump(index, f)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
enroll_face_dataset()
|
||||||
|
|
|
@ -4,7 +4,6 @@ import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import DBHelper
|
import DBHelper
|
||||||
|
|
||||||
|
|
||||||
def inference():
|
def inference():
|
||||||
try:
|
try:
|
||||||
import cPickle # Python 2
|
import cPickle # Python 2
|
||||||
|
@ -103,6 +102,5 @@ def inference():
|
||||||
DBHelper.set_motor("off")
|
DBHelper.set_motor("off")
|
||||||
cv2.destroyAllWindows()
|
cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
inference()
|
inference()
|
|
@ -15,7 +15,7 @@ def register_your_face(label):
|
||||||
if not folder:
|
if not folder:
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
|
|
||||||
cap = cv2.VideoCapture(1)
|
cap = cv2.VideoCapture(0)
|
||||||
c = 0
|
c = 0
|
||||||
while c < num_cap:
|
while c < num_cap:
|
||||||
ret, frame = cap.read()
|
ret, frame = cap.read()
|
||||||
|
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 73 KiB |
|
@ -13,8 +13,11 @@ def upload_your_face(firstname, lastname, email, phone):
|
||||||
for user in users.each():
|
for user in users.each():
|
||||||
count += 1
|
count += 1
|
||||||
DBHelper.upload_data("User_" + str(count), firstname, lastname, email, phone)
|
DBHelper.upload_data("User_" + str(count), firstname, lastname, email, phone)
|
||||||
|
print("Face registration start...")
|
||||||
Facial_Recognition_Registration.register_your_face("User_" + str(count))
|
Facial_Recognition_Registration.register_your_face("User_" + str(count))
|
||||||
|
print("Data saved! Starting enrollment...")
|
||||||
Facial_Recognition_Enrollment.enroll_face_dataset()
|
Facial_Recognition_Enrollment.enroll_face_dataset()
|
||||||
|
print("Face registration completed!")
|
||||||
for i in range(20):
|
for i in range(20):
|
||||||
DBHelper.upload_user_photo("User_" + str(count) + "/" + str(i) + ".jpg")
|
DBHelper.upload_user_photo("User_" + str(count) + "/" + str(i) + ".jpg")
|
||||||
except:
|
except:
|
||||||
|
|