date=frame_time.strftime("%Y/%m/%d %H:%M:%S"), msg=detected_msg)) for name in face_names: if name is None: continue if name not in detected_dict: detected_dict[name] = (init_time, 0) detected_time, count = detected_dict[name] if (frame_time - detected_time).seconds < 1: count += 1 detected_dict[name] = (detected_time, count) if count == 5: recognized_time = recognized_dict[name] if (frame_time - recognized_time).seconds > 120: data_store.add(frame_time, name) if name in cilab_people: notifier.notify(frame_time, cilab_people[name]) else: notifier.notify(frame_time, name) print("[recognized] {date} {name}".format( date=frame_time.strftime("%H:%M"), name=name)) recognized_dict[name] = frame_time else: detected_dict[name] = (frame_time, 1) cam.release() print("[log] Exit")