ML | Implement Face recognition using k-NN with scikit-learn
k-NN is one of the most basic classification algorithms in machine learning. It belongs to the supervised learning category of machine learning. k-NN is often used in search applications where you are looking for “similar” items. The way we measure similarity is by creating a vector representation of the items, and then compare the vectors using an appropriate distance metric (like the Euclidean distance, for example).
It is generally used in data mining, pattern recognition, recommender systems and intrusion detection.
Libraries used are:
haarcascade_frontalface_default.xml dataset which is easily available online and also you can download it from this link.
scikit-learn provides a range of supervised and unsupervised learning algorithms via a consistent interface in Python.
This library is built upon SciPy that must be installed on your devices in order to use scikit_learn.
This includes three Python files where the first one is used to detect the face and storing it in a list format, second one is used to store the data in ‘.csv’ file format and the third one is used recognize the face.
npwriter.py – Create/Update ‘.csv’: file
recog.py – Face-recognizer