merge
This commit is contained in:
commit
8ff03abb53
@ -55,7 +55,7 @@ void loop() {
|
||||
//if (Serial.read() == 'o') {
|
||||
digitalWrite(relayPin, HIGH);
|
||||
playBuzzer(300,true);
|
||||
delay(7000);
|
||||
delay(4000);
|
||||
digitalWrite(relayPin, LOW);
|
||||
IROK = false;
|
||||
UltraOK = false;
|
||||
|
5
main.py
5
main.py
@ -37,6 +37,7 @@ def init():
|
||||
go = False
|
||||
if (go):
|
||||
print('Starting Photo loop..')
|
||||
print('Known people are '+str(loadNames()))
|
||||
start(camera, face_cascade)
|
||||
|
||||
else:
|
||||
@ -57,7 +58,7 @@ def start( camera, face_cascade):
|
||||
init()
|
||||
img = rawCapture.array
|
||||
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
||||
faces = face_cascade.detectMultiScale(gray, 1.2,5)
|
||||
faces = face_cascade.detectMultiScale(gray, 1.3,5)
|
||||
i = 0;
|
||||
for (x,y,w,h) in faces:
|
||||
i += 1
|
||||
@ -87,7 +88,7 @@ def recognize(image,face_recognizer, names):
|
||||
label= face_recognizer.predict(img)
|
||||
except:
|
||||
print('[ Error ] Error in Recognize() function')
|
||||
if label[1] > 120:
|
||||
if label[1] > 100:
|
||||
return 'unknown'
|
||||
else:
|
||||
print(str(label) + ' >>'+names[label[0]])
|
||||
|
@ -125,3 +125,4 @@ def addName(newName):
|
||||
with open("faces/names.json","w") as write_file:
|
||||
json.dump(names,write_file)
|
||||
|
||||
start()
|
||||
|
Loading…
Reference in New Issue
Block a user