Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

simonjvardy/python-image-face-detection

Repository files navigation

Python - Detecting Faces in Images

About

This coding example is part of a Udemy Python course using Python to detect faces in images.


Technologies

Languages

  • Python3
    • Used to create the main application functionality

Libraries / Packages / Modules

  • OpenCV
    • open-source library that includes several hundreds of computer vision algorithms.
  • OpenCV haar-cascade
    • OpenCV xml data containing trained classifiers for detecting objects of a particular type e.g. faces, people, vehicles etc.

Tools


Deployment

The website was developed using VS Code & Git pushed to GitHub, which hosts the repository. I made the following steps to deploy the site:

Cloning python-image-face-detection

Prerequisites

Ensure the following are installed locally on your computer:

Cloning the GitHub repository

  • navigate to simonjvardy/python-image-face-detection GitHub repository.
  • Click the Code button
  • Copy the clone url in the dropdown menu
  • Using your favourite IDE open up your preferred terminal.
  • Navigate to your desired file location.

Copy the following code and input it into your terminal to clone Sportswear-Online:

git clone https://github.com/simonjvardy/python-image-face-detection.git

Creation of a Python Virtual Environment

Note: The process may be different depending upon your own OS - please follow this Python help guide to understand how to create a virtual environment.

Run the application locally

  • To run the face detection application, enter the following command into the terminal window:
python3 face_detect.py
  • the output image file contains the image with a green rectangle surrounding the detected face.

  • To run the face detection application for multiple faces, enter the following command into the terminal window:
python3 multi_face_detect.py
  • the output image file contains the image with a green rectangle surrounding the detected faces. In the example image below, OpenCv was unable to detect the face on the right chewing the newspaper page as it is partially obscured.


Acknowledgements

About

Using Python to detect faces within images

Topics

Resources

Readme

Stars

Watchers

Forks

Contributors