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