C++ Addon for fast and efficient face analytics
npm install nodoface
C++ Addon for fast and efficient facial analytics on Nodejs/TypeScript.
height="240" alt="CCExtractor Logo">cv::Mat)cv::Mat_)cv::Mat_)cv::rectangle())cv::putText()) (not working)cv::imshow())cv::imread())cv::imwrite)cv::destroyWindow())cv::destroyAllWindows())cv::waitKey())cv::VideoCapture)cv::VideoWriter)Step 1: Install OpenCV 3.4.x.
If opencv is already installed, ensure it is recognised by pkg-config by executing:
```
$ pkg-config --modversion opencv`
Step 2: Install dlib 19.13 or greater as a shared library (default is static).
Check this answer by DavisKing for compiling it as shared library.
Ensure it is recognised by pkg-config:`
$ pkg-config --modversion dlib`
Step 3: Install OpenFace. The original repo has some issues. It can only compile as static library.
So use my OpenFace fork instead. I have modified CMakelists.txt to compile OpenFace as shared lib.`
$ git clone https://github.com/sziraqui/OpenFace.git && cd OpenFace
$ git checkout dynamic-compile
$ ./download_models.sh
$ mkdir build && cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE CMAKE_CXX_FLAGS="-std=c++11" -D CMAKE_EXE_LINKER_FLAGS="-std=c++11"
$ make -j2
$ sudo make install`
Step 4: Compile the bindings.`
$ git clone https://github.com/sziraqui/nodoface.git && cd nodoface
$ npm install
Step 5 (Optional): Run tests
``
$ npm testnpm run clean:test
This will execute mocha tests. Some tests generate image outputs which can be checked in ./tests/outputs directory
To clear all files generated by tests, execute
If you encounter errors, see my gsoc notes for some assistance.
The addon is exported from ./api/nodoface.js
$ node examples/mtcnn_on_video.js path/to/a/video/file /lib/local/LandmarkDetector/model/mtcnn_detector/MTCNN_detector.txt
``