This project uses OpenCV's Face Detection Neural Network to recognize faces and anonymize them by blurring faces of each individual.
This project follows 4 steps:
- We use the webcam through OpenCV to obtain real time video.
- We detect faces of each individual using the OpenCV's Face detection Deep Neural Network. [NOTE]I have also added a program(main_HC.py) to do the same using a Haar Cascade Classifier. I found out that there is a difference in face detection accuracy while testing both of them in real time.I have added both the files.You can experiment with both of them.
- We have used two different methods to blur the faces. For simple blur, we have used a gaussian blur, and for pixelated blur, we have divided the roi(face) into blocks, and blurred each of them using mean BGR values.
- After blurring the roi(face), we replace the roi area of the actual webcam feed with the blurred image, and display it.
- Open the terminal.
- Clone the repository to your local machine.
- Navigate inside the folder.
- Install all dependencies using
pipenv install -r requirements.txtorpip install -r requirements.txt
- Run the main_DNN.py for detecting and blurring faces using OpenCV's Deep Neural Network.
- Run the main_HC.py for detecting and blurring faces using HaarCascade Classifier.