Uses HAR cascades for fast good-enough face detection. Uses SFace for face recognition via cosine similarity against model computed features of samples.
Remember:
- Face Detection: is there a face in the image?
- Face Recognition: whose face is in the image?
- Install/Compile libopencv-dev and opencv-data
- Install cmake, make, and g++
Will use -march=native
in order to enable SSE, AVX, et al. where possible.
make prepare
will prepare cmake directories and download model and it's LICENSE.make build
will build everythingmake sample
will run the sampler to capture 10 samples of a face using the computer camera and crop it to the bounding box found by the face detector.make recon
will run the recognizer and output "PASS" or "FAIL", with exit codes 0 or -1 respectively.
Binaries can be found on _build/
.
You can change the camera by changing the index (0) on:
#define CAMERA_INDEX 0
in both recbot_recon.cpp
and recbot_samples.cpp
. Use ls /dev/video*
to list, and note that not all devices are actual cameras.
Under ./examples/
you can check a simple face detection example using HAR Cascades.
If vscode intellisense is not working add "/usr/include/**" or equivalent to includePath
in the C/C++ properties (c_cpp_properties.json
).
- Command line argument parsing
- Make this work with PAM for authentication
- Ensure memory is not leaking, because right now this runs as a one shot POC and I didn't care.