From 87dec86a71c0d88c64a832409118852955c200dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Berk=20Ba=C5=9Fo=C4=9Flu?= Date: Sat, 14 Nov 2020 20:38:37 -0500 Subject: [PATCH] Fixed a Typo. --- Facial_Recognition_Wrapper.py | 15 ++++++++------- .../Facial_Recognition_Wrapper.cpython-36.pyc | Bin 6779 -> 6989 bytes start_engine.py | 4 ++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Facial_Recognition_Wrapper.py b/Facial_Recognition_Wrapper.py index b2e883cff..2b932e702 100644 --- a/Facial_Recognition_Wrapper.py +++ b/Facial_Recognition_Wrapper.py @@ -7,7 +7,8 @@ import numpy as np import Facial_Recognition_Render as fr import _pickle as cPickle import glob -'import Hardware.Motor' #Line 225-228 + +'import Hardware.Motor' # Line 225-228 faceWidth = 320 faceHeight = 320 @@ -172,13 +173,13 @@ def face_recognition_inference(rec_type): print(sys.path[0]) 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() print("Test using LBPH Faces") - elif (rec_type == 'Eigen'): + elif rec_type == 'Eigen': faceRecognizer = cv2.face.EigenFaceRecognizer_create() print("Test using Eigen Faces") - elif (rec_type == 'Fisher'): + elif rec_type == 'Fisher': faceRecognizer = cv2.face.FisherFaceRecognizer_create() print("Test using Fisher Faces") @@ -187,7 +188,7 @@ def face_recognition_inference(rec_type): cam = cv2.VideoCapture(0) - while (True): + while True: # imagePath = testFiles[i] success, original = cam.read() im = cv2.resize(original, (640, 480)) @@ -222,7 +223,7 @@ def face_recognition_inference(rec_type): text = '{} {}%'.format(labelsMap[predictedLabel], round(score, 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) - 'Hardware.Motor.Motor.stop_motor()' + 'Hardware.Motor.Motor.stop_alarm()' 'Hardware.Motor.Motor.start_motor()' 'Hardware.Motor.Motor.stop_motor()' 'Hardware.Motor.Motor.start_alarm()' @@ -241,7 +242,7 @@ if __name__ == "__main__": if mode == 'train': training_recognizer(rec_type) - elif (mode == 'test'): + elif mode == 'test': face_recognition_inference(rec_type) # video process (keep it in case if needed) diff --git a/__pycache__/Facial_Recognition_Wrapper.cpython-36.pyc b/__pycache__/Facial_Recognition_Wrapper.cpython-36.pyc index a1836dae4154f21e943d3b8d14b3b16f6e98d905..ad3761b3ab4de10530a06c681dd198c929a08fcb 100644 GIT binary patch delta 447 zcmexua@I`Qn3tC;vuQ)Tni>PcV+JI^1Y|n^aq*#v%Iyv*0x5zm3{j$~Vktt|Ohx-r zgrme$M4}{8#ZyFq{B^0qsS?eMj0|}KKoMb(ic}GZND5;xgQnQVM@dYKLYrNgZ!$3| zZKN#Le{3j1xC|2nn$=Moo?up9Um9i8}#FQ;8#tODF%5$YpGstSu$SC^6Yf ustd@zC1q`91auPzBN}98VFW^E4nYnH4ml1>4iOGd4v+{F2O}3qtug>!1Ty>p diff --git a/start_engine.py b/start_engine.py index 296f28c02..91ab4cdb2 100644 --- a/start_engine.py +++ b/start_engine.py @@ -28,3 +28,7 @@ def start(): print("No Thieves for now.") Facial_Recognition_Wrapper.training_recognizer("Fisher") Facial_Recognition_Wrapper.face_recognition_inference("Fisher") + + + +