import face_recognition
import numpy as np
def face_recognition_logic(encodeListKnown, encodeFace, classNames):
    matches = face_recognition.compare_faces(encodeListKnown, encodeFace)
    faceDis = face_recognition.face_distance(encodeListKnown, encodeFace)
    matchIndex = np.argmin(faceDis)

    if matches[matchIndex]:
        name = classNames[matchIndex].upper()
        return matches, matchIndex, name
    else:
        return matches, matchIndex, None