This project runs on Mediapipe TFLite models without using Mediapipe framework. It can run at 90+ FPS on CPU. I perform the test on an AMD Ryzen 7 3700U Pro and the app takes about 5% CPU while running. For more information:
- Face detection: https://google.github.io/mediapipe/solutions/face_detection.html
- Face landmarks: https://google.github.io/mediapipe/solutions/face_mesh.html
- Iris landmarks: https://google.github.io/mediapipe/solutions/iris.html
Because Tensorflow Lite only supports GPU delegate for Android and IOS. For more information: https://www.tensorflow.org/lite/performance/gpu
You can follow instructions at https://www.40tude.fr/compile-cpp-code-with-vscode-cmake-nmake/
How to install (Windows 64-bit)
- Download and install pre-built binaries at https://sourceforge.net/projects/opencvlibrary/files/4.5.3/opencv-4.5.3-vc14_vc15.exe/download
- Add
<opencv-install-folder>/build/x64/vc15/bin
and<opencv-install-folder>/build/x64/vc15/lib
to PATH.
How to use pre-built library
- Download and extract tensorflowlite.zip from https://github.com/shigure3011/mediapipe_face_iris_cpp/releases
- Change
TFLite_PATH
in CMakeLists.txt - Add
TFLite_LIBS
to PATH
- Clone this repo and go to FaceMeshCpp folder
- Run
cmake -S . -B build
- Run
cmake --build build --config Release --target FaceMeshCpp
- Now it will build an
.exe
at~/build/Release
. Make sure to copymodel
folder to~/build/Release/
before running.