crop=False) embedder.setInput(faceBlob) vec = embedder.forward() # perform classification to recognize the face preds = recognizer.predict_proba(vec)[0] j = np.argmax(preds) proba = preds[j] name = le.classes_[j] cv2.imwrite('img1.jpg', frame) if (name == "your name"): dawsenCount += 1 if (dawsenCount == 20): #send_sms.sendText('+friend number','Dawsen is home') send_sms.sendText('+your number', 'Dawsen is home') if (name == "friend name"): dawsenCount += 1 if (mirandaCount == 20): send_sms.sendText('+friend number', 'Miranda is home') if (name == "unkown"): unknownCount += 1 if (unknownCount == 50): send_sms.sendText( '+your number', '**** INTRUDER ****\nuknown person in your home') # draw the bounding box of the face along with the # associated probability text = "{}: {:.2f}%".format(name, proba * 100) y = startY - 10 if startY - 10 > 10 else startY + 10
def run(self): send=sendText() send.send_text()
def handler(self,event,button_event): print('Handler %s' % button_event) if button_event == 'press': send_sms.sendText()