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
- Pattern Recognition | Introduction
- Pattern Recognition | Basics and Design Principles
- Python | Named Entity Recognition (NER) using spaCy
- Python | Reading contents of PDF using OCR (Optical Character Recognition)
- Python | Speech recognition on large audio files
- ML | Unsupervised Face Clustering Pipeline
- Opencv Python program for Face Detection
- Face Detection using Python and OpenCV with webcam
- Speech Recognition in Python using Google Speech API
- How to implement Dictionary with Python3?
- Implement IsNumber() function in Python
- 5 Machine Learning Projects to Implement as a Beginner
- Python | Program to implement simple FLAMES game
- Python | Program to implement Jumbled word game
- Implement your own word2vec(skip-gram) model in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.