Skip to content

In this project I use OpenCV to build a simple face detection system that works on real-time

License

Notifications You must be signed in to change notification settings

cpatrickalves/cv-realtime-face-detection

Repository files navigation

Real-time face detection

In this project, I use OpenCV and Viola-Jones Algorithm to build a simple face detection system that works in real-time.

Getting Started

To detect the face the software uses the Haar-like features with the help of the haarcascade_eye.xml and haarcascade_frontalface_default.xml files.

Prerequisites

To run this code, download Python 3 from Python.org.

After installing Python, add the required package using pip installer:

pip install -r requirements.txt

Usage

To run the detection on real-time using the webcam, run:

python face_recognition.py

To perform the face detection on an image, just add the file name as an argument:

python face_recognition.py -f image.jpg

The script will create an output with a similar name. It with add the _output in the file name (ex: image_output.jpg)

Add the -s flag to perform smile detection.

Example

Web application

You can also run this script as an Streamlit application:

streamlit run app.py

It will automatically open the browser and show the app.

You can also test a demo on Heroku Plataform: Face Detection Demo

Built With

  • OpenCV - Open Computer Vision Library.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

In this project I use OpenCV to build a simple face detection system that works on real-time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published