def recog(self): name2 = self.name2.get() name3 = self.name3.get() emo = self.emotion.get() result = face_recognition.main(name2, name3, emo) if result == 2: tkinter.messagebox.showinfo('Result', 'Unlocked!') else: tkinter.messagebox.showinfo('Result', 'Recognition failed:(') return
def main(): mqttClient.on_connect = on_connect print("Connecting to " + host) mqttClient.connect(host, port, 60) #get returned ID from face_recognition recognized_id = face_recognition.main() if recognized_id != "unknown": mqttClient.publish("toEsp/control/device/3", "on") mqttClient.publish("fromRPi/log/face", recognized_id) print("Person regconized: " + recognized_id)
sys.stdout = self.stddirec output_text_window.pack() #Trigger the GUI. Light the fuse! if __name__ == "__main__": #Face detection path = 'C:/' lisdir = os.listdir(path) flag = 0 for lis in lisdir: # if users face is in dataset, then the following code will run for authentication if lis == 'dataset': face_recognition.main() flag = 1 if flag != 1: os.mkdir('C:/dataset') name = "admin" path = 'C:/dataset' cam = cv2.VideoCapture(0) ret, img = cam.read() cv2.imwrite(path + "/" + str(name) + ".jpg", img) cam.release() cv2.destroyAllWindows() #GUI root = tk.Tk() view = MyFrame(root)
def reconhecimento(self): face_recognition.main()