This repository holds the implementation of the face detection solutions listed in my blog posts.
- Part 1: SaaS vendors
- Part 2: Open source options
All face detection implementations are stored in the /src/solutions
folder.
If you want to run the face detection code yourself, read the relevant README.md
file located
in each solution's folder.
To add meta information to the images and generate a CSV export, following two classes have been written:
In order to execute shell commands to find faces, following class has been written:
- Dataset with images to be processed:
/dataset
- Information about how many faces to expect per image in the dataset (to calculate the success rate):
/dataset/face_counts.ini
- Processed datasets with metadata on the images:
/dataset-output
- CSV file with analytical data:
/dataset-output/results.csv
- Implementation of each solution:
/src/solutions/<solution>
- Custom classes:
/src/solutions
Important: The dataset-solutions
folder has been added to .gitignore
in order not to blow up the Git repository size.
In case you're interested to see the processed images used in my blog posts, you can download the complete set
from our file server.
As stated above, the code for each face detection solution can be found in the /src/solutions
folder.
If you want to run the code locally, please read the corresponding README.md
file located in the
/src/solutions
sub folders.
- Ageitgey - Face Recognition
- Dlib - CNN
- Dlib - HOG
- OpenCV - Deep learning
- OpenCV - Haar
- OpenCV - Haar (tweaked)
- OpenCV - LBP
Each solution run checks if a /dataset-output/results.csv
file exists.
If so, it will attach it's data to this CSV file. If not, it will create the file with the corresponding headers.
The face detection solutions will try to find faces in all images in the /dataset
directory.
You can extend the images or replace them with your own, as you wish.
Important: Only JPG and PNG images are supported for now!
All images currently stored in the /dataset
directory were downloaded from pexels.com,
many thanks to the contributors and photographers of the images and also to Pexels!
- 9746
- 9816
- 34692
- 109919
- 163087
- 167637
- 211050
- 233129
- 267885
- 280002
- 307847
- 325521
- 356147
- 403448
- 428364
- 546162
- 687501
- 708392
- 711009
- 745045
- 761963
- 787961
- 837306
- 840996
- 889545
- 914181
- 923657
- 933964
- 948199
- 1116302
- 1117256
- 1181562
- 1185440
Want to extend the listed solutions or simply enhance existing code?
I'm happy to receive and accept pull requests!
MIT License
Copyright (c) 2018 David Pacassi Torrico
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.