This article aims to show how we can use an OpenCV library to detect faces in a given image with minimal steps

I’m using a Google Colab Notebook to write my Python program. But, you can use any editor of your choice, like VS Code, PyCharm, etc.

All I’m doing here is that I’m passing an image to the OpenCV library and using it against a trained model to detect faces.

Here are the steps :

Step 1

Open a new Google Colab Notebook, and import two essential libraries matplotlib.pyplot and cv2

We’re using matplotlib to access a given image’s properties and cv2 to access a trained model and use the given image against it to detect faces

As humans, we’re going to make mistakes. It’s what makes us human, and most of the time, the most effective way of learning is from a mistake - Nash Grier

We use one of in almost every sentence/ conversation we have with the people around us in almost any context. But I have noticed some using them are grammatically incorrect. Here are some examples

  1. One of the key in my keyboard is not working. It sucks!
  2. You know what one of my colleague kept picking his nose in the meeting. And it was just so disgusting.
  3. One of the reason I left my job was him.
  4. He is one of the good person I have known in this industry.

All of these sentences are grammatically incorrect.

The point here is…

Explained using two simple and real-life examples

I believe, to programmers, these are the two famous and favorite friends. Also, one of the many interview questions. Many would know them theoretically and many would practically be implementing them in their programs too, but even after spending enough time, if you still show the following symptoms:

  • Are they both similar?
  • I know them by the bookish definitions, but sometimes I don’t get, how different they are?
  • Are they really two separate concepts? Because I feel they’re one and the same.
  • After looking at the program, I can’t really say, which is Encapsulation and which is Abstraction here?
  • If…

Pradeep Pradyumna

B.E. Graduate | Lead Developer | Theater-Enthusiast | Blogger | Husband

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store