unknown folder

This commit is contained in:
HeshamTB 2018-12-04 20:31:23 +00:00
parent 883d8a6697
commit e6de56c167

View File

@ -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()))
@ -90,6 +95,7 @@ def start( camera, face_cascade):
cv2.destroyAllWindows()
break
def recognize(image,face_recognizer, names):
try:
@ -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]])