HumanCenteredAI/olliedetection
0
1import face_recognition2import cv23import numpy as np4 5def verify_user(frame, known_encodings, known_names):6 rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)7 locations = face_recognition.face_locations(rgb)8 encodings = face_recognition.face_encodings(rgb, locations)9 10 for encoding in encodings:11 matches = face_recognition.compare_faces(known_encodings, encoding)12 if True in matches:13 return known_names[matches.index(True)]14 return None15 