diff --git a/main.py b/main.py index fc36531..43a4379 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,7 @@ except Exception as ex: def init(): go = True - print('Initilizing Camera and cascade components..') + print('Initilizing..') try: camera = PiCamera() camera.resolution = (640, 480) @@ -36,6 +36,11 @@ def init(): except: print('[ Error ] Can not load cascade File') go = False + try: + os.mkdir('unknown') + except OSError as ex: + print('Found (unknown) folder') + if (go): print('Starting Photo loop..') print('Known people are '+str(loadNames())) @@ -89,6 +94,7 @@ def start( camera, face_cascade): if cv2.waitKey(1) & 0xFF == ord('q'): cv2.destroyAllWindows() break + def recognize(image,face_recognizer, names): @@ -98,6 +104,7 @@ def recognize(image,face_recognizer, names): except: print('[ Error ] Error in Recognize() function') if label[1] > 70: + print(str(label)) return 'unknown' else: print(str(label) + ' >>'+names[label[0]])