AI Free CodeLatest

Face Recognition with Python and OpenCV

Hello Guys, we hope you and your family are safe. Today, we have come up with a new python tutorial to build a face recognition program based on Python and OpenCV. As asked by some of the followers on Instagram (@_tech_tutor). Today in this tutorial we are going to show something real beautiful program. Here, we are using Python 3.7.3, OpenCV, and some other Python libraries (NumPy, Dlib, CMake, and face_recognition) to build a face recognition program. But, the interesting point is that you can use any version of Python and OpenCV to run this script.

Keep in mind, You just need to install a C++ compiler on your computer. You can download the C++  compiler while installing the Visual Studio Community version. 

We are going to develop a Python script that can detect whatever faces you like, it may be faces of your friends, faces of your relatives, faces of your best celebrities, faces of your idol. So, after developing a Python script you will be able to detect and recognize any faces you like and as many as you like. So what it does in this Python Script is actually drawing rectangular boxes around the faces and attempting to classify which ones they are based on a list of the provided faces. Otherwise, it will just show unknown but it still draws a rectangular box around the face. 

STEPS TO RUN CODE

  • a. Install the Python modules which are specified in "requirements.txt"
  • b. Within the root directory, there is the folder named “faces” which includes all the known faces, and that will be how faces of people are recognized and detected by the system.
  • c. Within the root directory, there is the folder named “test” where you can place your own images in which faces are recognized and detected.
  • d. The final step is to run the python script named “face_rec.py”.

At last, Press ‘q’ to exit the program

Finally, you can download project codes from the link given below:-

SCREENSHOT

Image of face recognition

!! Download code Now !!


My View

It is not a simple task to detect and recognize the name of a person through images. The actual work is not easy, although it looks simple. We have got a variety of algorithms and models while researching and studying different papers. There was a huge doubt as to whether it would be complete or not while pursuing this project i.e. “Face Recognition and Detection”. This project has been successful as it was expected. Additional features like an explanation of look were added for better performance to identify the detect and recognize the name of the person. Time management was one of the challenging jobs because of the late completion of the project. However, information from different sources like reports, conferences, and books help us complete this project. The project was completed successfully due to numerous resources and libraries used.

Future Plans

In the future, the following improvement can be done in this project:

  • a. Deploy program on web and camera.
  • b. Use a large number of images for “Face Detection and Recognize”.
  • c. Save the images in the database.
  • d. Improve the user interface of the system.
  • e. Live detect of the face by opening webcam and camera.

☺ Thanks for your time ☺

What do you think of this “Face Recognition with Python and OpenCV“? Let us know by leaving a comment below. (Appreciation, Suggestions, and Questions are highly appreciated).

9 thoughts on “Face Recognition with Python and OpenCV

Leave a Reply

Your email address will not be published. Required fields are marked *