• This repository has been archived on 27/Aug/2021
  • Stars
    star
    157
  • Rank 238,399 (Top 5 %)
  • Language
    Jupyter Notebook
  • Created about 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Face Detection with Python using OpenCV

Face Detection with Python using OpenCV

Binder

Face detection is a computer vision technology that helps to locate/visualize human faces in digital images. This technique is a specific use case of object detection technology that deals with detecting instances of semantic objects of a certain class (such as humans, buildings or cars) in digital images and videos. With the advent of technology, face detection has gained a lot of importance especially in fields like photography, security, and marketing.

Objective

This is the repository linked to the tutorial with the same name. The idea is to introduce people to the concept of object detection in Python using the OpenCV library and how it can be utilized to perform tasks like Facial detection.

Blogpost

Face Detection with Python using OpenCV

Installation

OpenCV-Python supports all the leading platforms like Mac OS, Linux, and Windows. It can be installed in either of the following ways:

1. From pre-built binaries and source :

Please refer to the detailed documentation here for Windows and here for Mac.

2. Unofficial pre-built OpenCV packages for Python.

Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution)

run pip install opencv-python if you need only the main modules run pip install opencv-contrib-python if you need both main and contrib modules (check extra modules listing from OpenCV documentation)

Table Of Contents

Images as Arrays

An image is nothing but a standard Numpy array containing pixels of data points. More the number of pixels in an image, the better is its resolution. You can think of pixels to be tiny blocks of information arranged in form a 2 D grid and the depth of a pixel refers to the colour information present in it. In order to be processed by a computer, an image needs to be converted into a binary form. The colour of an image can be calculated as follows:

  Number of colours/ shades = 2^bpp where bpp represents bits per pixel.

Naturally, more the number of bits/pixels , more possible colours in the images. The following table shows the relationship more clearly.

Let us now have a look at the representation of the different kinds of images:

  1. Binary Image
  2. Grayscale image
  3. Coloured image

Images and OpenCV

In this section we will perform simple operations on images using OpenCV like opening images, drawing simple shapes on images and interacting with images through callbacks. This is necessary to create a foundation before we move towards the advanced stuff.

Basic Operation on Images

In this section, we will learn how we can draw various shapes on an existing image to get a flavour of working with OpenCV.

Face Detection

Face detection is a technique that identifies or locates human faces in digital images. A typical example of face detection occurs when we take photographs through our smartphones, and it instantly detects faces in the picture. Face detection is different from Face recognition. Face detection detects merely the presence of faces in an image while facial recognition involves identifying whose face it is.

Face detection is performed by using classifiers. A classifier is essentially an algorithm that decides whether a given image is positive(face) or negative(not a face). A classifier needs to be trained on thousands of images with and without faces. Fortunately, OpenCV already has two pre-trained face detection classifiers, which can readily be used in a program. The two classifiers are: Haar Classifier and Local Binary Pattern(LBP) classifier.

Haar feature-based cascade classifiers

More Repositories

1

Building-a-Simple-Chatbot-in-Python-using-NLTK

Building a Simple Chatbot from Scratch in Python (using NLTK)
Jupyter Notebook
571
star
2

Data-Science-Articles

A collection of my blogs on Data Science and Machine learning.
Jupyter Notebook
84
star
3

Data-Visualisation-libraries

A Repository consisting of various visualisation libraries and tools
HTML
73
star
4

Building-a-Conversational-Chatbot-for-Slack-using-Rasa-and-Python

A guide to creating a chatbot with Rasa stack and Python and deploying it on Slack
Jupyter Notebook
68
star
5

10-Simple-hacks-to-speed-up-your-Data-Analysis-in-Python

Some useful Tips and Tricks to speed up the data analysis process in Python.
60
star
6

Satellite-Imagery-Analysis-with-Python

Getting acquainted with the concept of satellite imagery data and how it can be analyzed to investigate real-world environmental and humanitarian challenges.
Jupyter Notebook
49
star
7

Animations-with-Matplotlib

Using the matplotlib library to create some interesting animations.
Jupyter Notebook
44
star
8

What-I-learnt-by-interviewing-numerous-Kaggle-Grandmasters

37
star
9

An-Overview-of-Python-Datatable-package

Python library for efficient multi-threaded data processing, with the support for out-of-memory datasets.
Jupyter Notebook
27
star
10

A-guide-to-Machine-Learning-in-R

A series of articles to get started into the field of Machine Learning with R language
R
25
star
11

Image-Processing-in-Python

This repository contains the links to the article that I wrote on Medium pertaining to Image processing.
Jupyter Notebook
23
star
12

Visualising-Geospatial-data-with-Python

An overview of the Folium library to visualize Geospatial data
HTML
19
star
13

Explainable-AI-Workshop

Jupyter Notebook
17
star
14

Data-Visualisation-with-R

An article on visualisation Data with R: from basic plots to advanced.
HTML
15
star
15

Elements-of-Functional-Programming-in-Python

Learn how to how to use the lambda, map, filter and reduce functions in Python to transform data structures.
Jupyter Notebook
15
star
16

Analysing-Machine-Learning-Models-with-Yellowbrick

Yellowbrick is an open source, Python project that extends the scikit-learn API with visual analysis and diagnostic tools
Jupyter Notebook
13
star
17

Kaggle-Starter-Codes

A repository containing link to some my Kaggle starter Notebooks
11
star
18

Machine-learning-with-H2O-in-Python

Jupyter Notebook
9
star
19

Predicting-the-Future-with-Facebook-s-Prophet

Forecasting Medium's statistics using Facebook's Prophet Library
Jupyter Notebook
8
star
20

Audiofy-2

Python
7
star
21

H2O.ai-Meetup-Repository

Slides and code examples for H2O tutorials at various events
Jupyter Notebook
5
star
22

Useful-String-Methods-in-Python

Learn about some of Python's built-in methods that can be used on strings
Jupyter Notebook
5
star
23

Recreating-Gapminder-in-Tableau

4
star
24

Meetups

Jupyter Notebook
4
star
25

blog

HTML
2
star
26

parulnith

1
star