LibMP Example Usage Application
- See LibMP - MediaPipe as a Shared Library for more information on LibMP
- This example application does the following in realtime:
- Streams video frames from an attached camera/webcam (OpenCV Device #0)
- Runs MediaPipe Face Mesh on each frame
- Uses LibMP to get the XYZ coordinates of detected landmarks
- Draws a circle at each landmark's location on the input frame
- Displays the result using OpenCV/HighGUI
- Compilation is managed using CMake - see
CMakeLists.txt
and libprotobuf.cmake
- Change
${MEDIAPIPE_DIR}
in CMakeLists.txt
to match your installation of LibMP
- Other MP example graphs should be supported, though they I haven't yet tested them. As described below, any of MediaPipe's many Protobuf-based data types should work with LibMP.
- Tested on Windows (MSVC 17.3.5)
Prerequisites
- Clone and build LibMP
Usage
- Compile using CMake
cd
into output directory containing main
binary
- Run
main
binary
How it Works
Some (most?) MediaPipe data types are based on Protobuf messages. Thus, their data can be easily serialized and deserialized. LibMP provides functions which accomplish this, and this project imports both Protobuf & the Protobuf-based MediaPipe types - allowing for practically native use of MediaPipe data types in an external C++ application.
Contributions
Questions, suggestions, issues, pull requests, etc. are all welcome!