Face Detection in Python

In this blog we’ll be focusing on the implementation of Face Detection using Python.

Python Installation

Make sure to install the Python. I’m using Python 3.8.0 to check your current python version run python3 — version in your terminal.

Package Installation In Python

Install OpenCV in python using the command pip3 install opencv-python.

Adding Required Assets

Adding required assets in the project folder.
First add the frontalface xml file. Download the haarcascade_frontalface_default.xml from the Github Repo.
Add a image in the project directory.

Python Program

I have named the image as sample.jpeg you need to change it accordingly.

Run your Program

Run your program using the Command line python3 main.py or if you using vsCode press F5 to run.

Hurrah! and we are done with the Face Recognition using Python.

Do you know you can press the clap👏 button 50 times? The higher you go, the more it motivates me to write more stuff for you guys!
Hello, I am Agnel Selvan. A noob developer. You can find me on Linkedin or stalk me on GitHub.

--

--

--

I’m an IOS, Flutter Developer and now a Blogger

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Parallelize and Distribute Collection in PySpark

36 architecturalist papers: multi-tenancy and isolation primitives

Code Complete 2 Review: Software Construction and Metaphors (Part 1)

Elixir Phoenix: Creating An App With Tests (Part 6: Using The YouTube API)

Every Tech Article Ever, Part 2/3

GSoC’21: Refactoring code and formalizing unit tests

Announcing Nahmii’s $100 Million Per-project Development Incentive Program

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
Agnel Selvan

Agnel Selvan

I’m an IOS, Flutter Developer and now a Blogger

More from Medium

How to perform 5 most famous types of Thresholding Techniques in Python using OpenCV

Face Detection using Haarcascade Classifier and OpenCV

Face mask detection with deep learning

Image Colorizer using Deep Learning