GithubHelp home page GithubHelp logo

alex-lechner / face-eyes-smile-detection Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 7.0 403 KB

A face, eyes, and smile detector using Haar-like features with OpenCV.

Python 100.00%
face-detection smile-detection opencv computer-vision haar-cascade haar-cascade-classifier haar-features haar-classifiers

face-eyes-smile-detection's Introduction

Face-Eyes-Smile Detection


Detection of faces, eyes, and smiles

This project uses Haar-like features to detect faces, eyes, and smiles. It is done in Python 3.6 and uses the open source computer vision library OpenCV. To install OpenCV for Python please follow the installation process below.

By executing the script the internal webcam gets started and draws blue rectangles around faces, green rectangles around eyes and red rectangles around smiling mouths in the webcam video stream.

Face and eyes detection only Face, eyes and smile detection
no-smile smile

To start the face-eyes-smile detection clone this repository, open a terminal/command window and execute the following line in the root folder of this project:

python face_detection.py

If you don't have an internal webcam and you want to use an external webcam simply change the parameter of the cv2.VideoCapture() function on line 90 in face_detection.py from 0 to 1 like so:

# 0 = internal webcam, 1 = external webcam
VIDEO_CAPTURE = cv2.VideoCapture(1)

In order to take a screenshot and save it into the imgs folder simply press the s-key on your keyboard*.

To close and exit the webcam video stream press the Esc-key on your keyboard*.

*while the window of your webcam video stream is active

Installation of OpenCV

To install the OpenCV library for Python execute the following line in a terminal/command window:

pip install opencv-python

If you are on Windows and the line above does not work then download the OpenCV wheel from the Unofficial Windows Binaries for Python Extension Packages Website.

Because this project was done in Python 3.6 you need to download either opencv_python‑3.4.3‑cp36‑cp36m‑win32.whl for a 32-bit operating system or opencv_python‑3.4.3‑cp36‑cp36m‑win_amd64.whl for a 64-bit operating system.

Note: cp36 stands for the Python version 3.6 so if you are using Python 3.7 you will need to look for cp37 in the filename.

After you have downloaded the proper file you need to navigate to the location where this file was downloaded (probably your Downloads-folder) and open the command window in this folder. Then execute the following line:

# Python 3.6 for 32-bit OS
pip install opencv_python‑3.4.3‑cp36‑cp36m‑win32.whl

# Python 3.6 for 64-bit OS
pip install opencv_python‑3.4.3‑cp36‑cp36m‑win_amd64.whl

face-eyes-smile-detection's People

Contributors

alex-lechner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.