https://github.com/data-science-lab-amsterdam/face-recognition
Scripts and app for face recognition
https://github.com/data-science-lab-amsterdam/face-recognition
computer-vision face-detection face-recognition flask multithreading
Last synced: about 2 months ago
JSON representation
Scripts and app for face recognition
- Host: GitHub
- URL: https://github.com/data-science-lab-amsterdam/face-recognition
- Owner: data-science-lab-amsterdam
- Created: 2018-10-22T10:11:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-24T11:42:34.000Z (over 7 years ago)
- Last Synced: 2025-09-08T08:50:35.265Z (10 months ago)
- Topics: computer-vision, face-detection, face-recognition, flask, multithreading
- Language: Python
- Size: 24.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Face recognition
See this blog post for an in-depth walkthrough: https://medium.com/data-science-lab-amsterdam/face-recognition-with-python-in-an-hour-or-two-d271324cbeb3
The facial recognition works roughly as follows:

* Webcam provides an image
* A face detection algorithm (HOG) detects where in the image a face is located
* This part of the image is cut out and serves an input to the model
* The model is a (modified) ResNet CNN encoding the input to a feature vector of length 128
* We have a small database with feature vectors of portraits or our DSL colleagues
* The best match is found using a simple distance metric between the feature vectors
## Installation
* Create an environment and install the requirements.
N.B. Before installing dlib you need to have some other stuff installed. See https://www.pyimagesearch.com/2018/01/22/install-dlib-easy-complete-guide/
* git clone the repo
* Put one picture of each person of interest in the ./images folder
### Running
There are various ways to run the scripts:
* ```python src/main-webcam-simple.py```
Shows the image in a separate window. Cleanest and most simnple version. Not recommended for performance.
*N.B. The camera window doesn't close on a Mac due to some OpenCV bug!*
* ```python src/main-advanced.py -d -s```
The ```-d``` enables a video window
The ```-s``` enables sound
The ```-n``` enables network camera as video source (if you've supplied the right url in the configuration)
* ```python src/dash-app.py```
For a nice dashboard, accessible via http://127.0.0.1:8234/