


Train the modelįirst import the necessary modules. The face_recognition library contains the implementation of the various utilities that help in the process of face recognition. Now, create 2 lists that store the names of the images (persons) and their respective face encodings. path = "./train/"įace encoding is a vector of values representing the important measurements between distinguishing features of a face like the distance between the eyes, the width of the forehead, etc. We loop through each of the images in our train directory, extract the name of the person in the image, calculate its face encoding vector and store the information in the respective lists.
