AI Real time face Detection using WebCam (PYTHON)

For Real Time Face Detection we are going to use  opencv  library:-


Let's get started-

  1. To Installing the library simply open the terminal window and type -                                                                                                                                                                                                                                      "pip install opencv-python"                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                             
  2. Then we have to import library                                                                                                                                                                                                                                                                                 

                                                
  3. For this we are going to use Haarcascade algorithm                                                                            (you can download the package from below)                                                                                                                                                           
  4. We will use the cv::CascadeClassifier class to detect objects in a video stream. Particularly, we will use the functions:                                                                                             cv::CascadeClassifier::load to load a .xml classifier file.                                                                       cv::CascadeClassifier::detectMultiScale to perform the detection.                                                         

             
                           
  5. The image or the frames are then turned to grayscale Because it is a one layer image from 0-255 whereas the RGB have three different layer image, thus it makes it easier to detect faces.                                                                                                                                                                       

                                             
  6.  Now download the package and code  from here                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                      
  7. Run the code in Terminal.
       

                                                        













If  you want to change the colour of  box detecting the face you can change the RGB values 



 
(To End the Program you need to Kill the Terminal)                                                     



                                                                      And it's done.                                                                                                                                                                              

Comments

  1. hey that's a quit impressive work u did wanna see more of ur work keep onto ur efforts man !

    ReplyDelete

Post a Comment

Popular posts from this blog

Displaying Current Location on Map Using Leaflet JS

XML parsing using python