Face Detection Using Python

by Ajay Singh in Circuits > Computers

526 Views, 1 Favorites, 0 Comments

Face Detection Using Python

Screenshot (8).png
Screenshot (7).png

Dear Learners,

This is a very simple tutorial to detect face using python programming.

This code can be used for raspberry pi projects also . In this setup I am using the laptop.to detect the face ,eye and mouth .

If you face any difficulty let me know in the comment box.

Happy Learning!!

Setting Up the System.

Screenshot (2).png
Screenshot (3).png
Screenshot (4).png

we need to download python from the website :https://www.python.org/

Note: During installation please tick the pip during the installation.


Install Opencv by running the code in the terminal(command prompt)

as shown in the picture :pip install opencv-python


Install Numpy using the command : pip install numpy

All the library are done .

Face Detection Program and Harcascade(all Source Codes Included)

Screenshot (5).png
Screenshot (6).png
Screenshot (7).png

Create a Folder where we will keep the harcascade for the frontal face. This harcasade is required for detecting the face .

Open the python code and run by pressing F5 on the keyboard.

To come out of the window please press esc button .

Note: Download both the files and keep inside same folder

Face Detection and Eye Detection Program and Harcascade(all Source Codes Included)

Screenshot (8).png
Screenshot (10).png

Dear Learners.

Now we can use another harcascade (eye harcascade) in another folder and we can detect the eye in the face.

So again keeping it in the simple way just download all the files related to this and keep it in one folder.

Note: If you face any problem let me know in the comment section .

Face ,Eye & Mouth Detection Program and Harcascade(all Source Codes Included)

Screenshot (15).png
Screenshot (16).png

Dear Learners,

Here again all the codes and library is included.

Please download the files and keep in a folder.

I have found that Mouth detection is not so accurate !!

Note : to understand the code you can follow the youtube video link .


Happy Learning !!

Ajay Singh


-----------------------Thank you and have a great Day-----------------------------------