Fixed a Typo.
This commit is contained in:
parent
cf228272a8
commit
87dec86a71
3 changed files with 12 additions and 7 deletions
|
@ -7,7 +7,8 @@ import numpy as np
|
||||||
import Facial_Recognition_Render as fr
|
import Facial_Recognition_Render as fr
|
||||||
import _pickle as cPickle
|
import _pickle as cPickle
|
||||||
import glob
|
import glob
|
||||||
'import Hardware.Motor' #Line 225-228
|
|
||||||
|
'import Hardware.Motor' # Line 225-228
|
||||||
|
|
||||||
faceWidth = 320
|
faceWidth = 320
|
||||||
faceHeight = 320
|
faceHeight = 320
|
||||||
|
@ -172,13 +173,13 @@ def face_recognition_inference(rec_type):
|
||||||
print(sys.path[0])
|
print(sys.path[0])
|
||||||
landmarkDetector = dlib.shape_predictor(sys.path[0] + '/Facial_models/shape_predictor_68_face_landmarks.dat')
|
landmarkDetector = dlib.shape_predictor(sys.path[0] + '/Facial_models/shape_predictor_68_face_landmarks.dat')
|
||||||
|
|
||||||
if (rec_type == 'LBPH'):
|
if rec_type == 'LBPH':
|
||||||
faceRecognizer = cv2.face.LBPHFaceRecognizer_create()
|
faceRecognizer = cv2.face.LBPHFaceRecognizer_create()
|
||||||
print("Test using LBPH Faces")
|
print("Test using LBPH Faces")
|
||||||
elif (rec_type == 'Eigen'):
|
elif rec_type == 'Eigen':
|
||||||
faceRecognizer = cv2.face.EigenFaceRecognizer_create()
|
faceRecognizer = cv2.face.EigenFaceRecognizer_create()
|
||||||
print("Test using Eigen Faces")
|
print("Test using Eigen Faces")
|
||||||
elif (rec_type == 'Fisher'):
|
elif rec_type == 'Fisher':
|
||||||
faceRecognizer = cv2.face.FisherFaceRecognizer_create()
|
faceRecognizer = cv2.face.FisherFaceRecognizer_create()
|
||||||
print("Test using Fisher Faces")
|
print("Test using Fisher Faces")
|
||||||
|
|
||||||
|
@ -187,7 +188,7 @@ def face_recognition_inference(rec_type):
|
||||||
|
|
||||||
cam = cv2.VideoCapture(0)
|
cam = cv2.VideoCapture(0)
|
||||||
|
|
||||||
while (True):
|
while True:
|
||||||
# imagePath = testFiles[i]
|
# imagePath = testFiles[i]
|
||||||
success, original = cam.read()
|
success, original = cam.read()
|
||||||
im = cv2.resize(original, (640, 480))
|
im = cv2.resize(original, (640, 480))
|
||||||
|
@ -222,7 +223,7 @@ def face_recognition_inference(rec_type):
|
||||||
text = '{} {}%'.format(labelsMap[predictedLabel], round(score, 5))
|
text = '{} {}%'.format(labelsMap[predictedLabel], round(score, 5))
|
||||||
cv2.rectangle(original, (x1, y1), (x2, y2), (0, 255, 0), 5)
|
cv2.rectangle(original, (x1, y1), (x2, y2), (0, 255, 0), 5)
|
||||||
cv2.putText(original, text, (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 0), 3)
|
cv2.putText(original, text, (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (0, 255, 0), 3)
|
||||||
'Hardware.Motor.Motor.stop_motor()'
|
'Hardware.Motor.Motor.stop_alarm()'
|
||||||
'Hardware.Motor.Motor.start_motor()'
|
'Hardware.Motor.Motor.start_motor()'
|
||||||
'Hardware.Motor.Motor.stop_motor()'
|
'Hardware.Motor.Motor.stop_motor()'
|
||||||
'Hardware.Motor.Motor.start_alarm()'
|
'Hardware.Motor.Motor.start_alarm()'
|
||||||
|
@ -241,7 +242,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
if mode == 'train':
|
if mode == 'train':
|
||||||
training_recognizer(rec_type)
|
training_recognizer(rec_type)
|
||||||
elif (mode == 'test'):
|
elif mode == 'test':
|
||||||
face_recognition_inference(rec_type)
|
face_recognition_inference(rec_type)
|
||||||
|
|
||||||
# video process (keep it in case if needed)
|
# video process (keep it in case if needed)
|
||||||
|
|
Binary file not shown.
|
@ -28,3 +28,7 @@ def start():
|
||||||
print("No Thieves for now.")
|
print("No Thieves for now.")
|
||||||
Facial_Recognition_Wrapper.training_recognizer("Fisher")
|
Facial_Recognition_Wrapper.training_recognizer("Fisher")
|
||||||
Facial_Recognition_Wrapper.face_recognition_inference("Fisher")
|
Facial_Recognition_Wrapper.face_recognition_inference("Fisher")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue