https://github.com/ncravino/recbot
Experiments in Computer Vision: Face Detection and Face Recognition using OpenCV
https://github.com/ncravino/recbot
computer-vision cpp deep-learning face-detection face-recognition harcascades opencv sface
Last synced: about 2 months ago
JSON representation
Experiments in Computer Vision: Face Detection and Face Recognition using OpenCV
- Host: GitHub
- URL: https://github.com/ncravino/recbot
- Owner: ncravino
- License: bsd-3-clause
- Created: 2023-09-07T19:48:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-07T21:36:54.000Z (almost 3 years ago)
- Last Synced: 2026-05-06T18:53:10.254Z (about 2 months ago)
- Topics: computer-vision, cpp, deep-learning, face-detection, face-recognition, harcascades, opencv, sface
- Language: C++
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RECBOT: Experiments on Face detection and recognition
Uses HAR cascades for fast good-enough face detection.
Uses [SFace](https://github.com/opencv/opencv_zoo/tree/main/models/face_recognition_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?
## Dependencies
- 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.
## Using
- `make prepare` will prepare cmake directories and download model and it's LICENSE.
- `make build` will build everything
- `make 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/`.
## Notes:
### Choosing the camera
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.
### Simple Detection Example
Under `./examples/` you can check a simple face detection example using HAR Cascades.
## Troubleshooting:
If vscode intellisense is not working add "/usr/include/**" or equivalent to `includePath` in the C/C++ properties (`c_cpp_properties.json`).
## TODO:
- 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.