Face Recognition with RetinaFace and ArcFace.
This project uses TensorRT, OpenCV and cuBLAS to implement a face recognition system with simple SQLite database and Web APIs via Crow.
- CUDA 11.3
- TensorRT 8.2.2.1
- OpenCV 4.5.5
- SQLite 3.31.1
- Crow 1.0
- Boost 1.79.0
git clone https://github.com/nghiapq77/face-recognition-cpp-tensorrt.git
cd face-recognition-cpp-tensorrt
cd app
mkdir build && cd build
cmake ..
make -j$(nproc)
cd main
mkdir build && cd build
cmake ..
make -j$(nproc)
- Python 3.8
- torch 1.11.0+cu113
- torchvision 0.12.0+cu113
Using torch2trt_dynamic.
cd conversion/[retina/arcface]
python torch2trt.py
cd app/build
./app -c <config-file>
Example:
curl localhost:18080/insert/user -d '{"userId": "morty", "userName": "Morty Smith"}'
curl localhost:18080/insert/face -d '{"data": [{"userId": "morty", "imgPath": "<absolute-path-to-this-repo>/imgs/1.jpg"}]}'
curl localhost:18080/reload
cd main/build
./main
Visualized result from example.