We use the haar cascade algorithm to detect face on each pixels. (we included the default one in this repository). more infor about the haar cascade here: https://towardsdatascience.com/face-detection-with-haar-cascade-727f68dafd08
and the different optional algorithm can be found here: https://github.com/opencv/opencv/tree/master/data/haarcascades
We load the cv2 library with a specific algorithm and them create a loop while launching the webcam to detect all the matching face elements. For each of them we draw a rectangle over it.
Make sure to have python3 installed on your computer. Make sure to have cv2 installed on your computer. The recommended way is to do it through the pip manager:
sudo apt install python3-pip # On linux only, consider brew for mac
pip install opencv-python
git clone https://github.com/erwanriou/face_detection_app.git
cd face_detection_app
python index.py