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.
- Python
2.x
or3.x
- NumPy
- OpenCV
- Clone
face-capture
repository into a local directory.
git clone https://github.com/kghamilton89/face-capture.git
- 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
- Install NumPy:
sudo apt-get install python-numpy
- 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 incapture.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
).
- Navigate to the repository directory.
cd ./path/to/face-capture
- Enable execute permissions and run
capture.py
.
chmod +x capture.py
python capture.py
capture.py
writes the resulting photo to the same directory as res.jpg
. Configure this behavior on line 32 of capture.py