Face mesh generator using the Iris Mesh Mediapipe model with a CPU delegate written in C++
- Plain C/C++ implementation with minimal dependencies (Tensorflow Lite + OpenCV)
- Google MediaPipe models without the MediaPipe framework
- Runs on ARM
This library offers support for:
- 3D Iris Landmarking (5x3D points)
- Iris contour and eye-brow landmarks (71 points)
This is some example code for Iris landmarking:
/* Create instance of Iris landmarker */
CLFML::IrisMesh::IrisMesh iris_det;
/* Load image into model and do inference! */
iris_det.load_image(eye_roi_cropped_frame);
/* Get the iris mesh keypoints from the model inference output */
std::array<cv::Point3f, 5> iris_mesh_keypoints = iris_det.get_iris_mesh_points();
For a full example showcasing both these API functions see the example code in example/iris_mesh_demo/demo.cpp.
Before using this library you will need the following packages installed:
- OpenCV
- Working C++ compiler (GCC, Clang, MSVC (2017 or Higher))
- CMake
- Ninja (Optional, but preferred)
- Clone this repo
- Run:
cmake . -B build -G Ninja
- Let CMake generate and run:
cd build && ninja
- After building you can run (linux & mac):
./iris_mesh_demo
or (if using windows)
iris_mesh_demo.exe
Add this to your top-level CMakeLists file:
include(FetchContent)
FetchContent_Declare(
iris_mesh.cpp
GIT_REPOSITORY https://github.com/CLFML/Iris_Mesh.Cpp
GIT_TAG main
# Put the Iris_Mesh lib into lib/ folder
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/lib/Iris_Mesh.Cpp
)
FetchContent_MakeAvailable(iris_mesh.cpp)
...
target_link_libraries(YOUR_EXECUTABLE CLFML::iris_mesh)
Or manually clone this repo and add the library to your project using:
add_subdirectory(Iris_Mesh.Cpp)
...
target_link_libraries(YOUR_EXECUTABLE CLFML::iris_mesh)
See our wiki...
- Add language bindings for Python, C# and Java
- Add support for MakeFiles and Bazel
- Add Unit-tests
- Add ROS2 package support
This work is licensed under the Apache 2.0 license.
The iris_mesh model is also licensed under the Apache 2.0 license.