/face-capture

Locate and label faces in photos.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Face Capture

A simple tool which locates and labels faces in photographs. Use this algorithm as the foundation for a more in-depth process. This tool uses NumPy and OpenCV libraries. Free as in Freedom.

Requirements

  • Python 2.x or 3.x
  • NumPy
  • OpenCV

Instructions

  1. Clone face-capture repository into a local directory.
git clone https://github.com/kghamilton89/face-capture.git
  1. Install OpenCV:
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt install python-opencv
  1. Install NumPy:
sudo apt-get install python-numpy
  1. Store the photo to be analyzed in the same directory as the repository with the name test.jpg. The algorithm defines this parameter on line 11. Define a different file name or format in capture.py to use custom parameters.

Supported extensions: Windows bitmap (bmp), portable image formats (pbm, pgm, ppm), Sun raster (sr, ras), JPEG (jpeg, jpg, jpe), JPEG 2000 (jp2), TIFF files (tiff, tif), and portable network graphics (png).

  1. Navigate to the repository directory.
cd ./path/to/face-capture
  1. Enable execute permissions and run capture.py.
chmod +x capture.py
python capture.py

Results

Input

Output

capture.py writes the resulting photo to the same directory as res.jpg. Configure this behavior on line 32 of capture.py

Živio Tito!