The repo demonstrates proof-of-concept of making shared library in Mediapipe (see TODO section) and running Mediapipe apps with Rust.
The repos is an adaptation of famous Mediapipe FaceMesh example.
- bazel
- opencv
Clone the repo:
git clone --recurse-submodules https://github.com/yevhen-k/face-mesh-rust.git
Initialize prerequisites:
./init.sh
The following vars are optional to make simple tests of cpp demo: TEST_DEMO=1
, TEST_DEMO=2
, TEST_DEMO=3
:
TEST_DEMO=1 ./init.sh
See init.sh for more details.
To see help:
LD_LIBRARY_PATH=./lib/ cargo run --bin demo -- --help
To test FaceMesh with your WebCam:
LD_LIBRARY_PATH=./lib/ cargo run --bin demo -- --calculator-graph-config-file=thirdparty/mediapipe/graphs/face_mesh/face_mesh_desktop_live.pbtxt
To test FaceMesh on a video file with output to opencv window:
LD_LIBRARY_PATH=./lib/ cargo run --bin demo -- --calculator-graph-config-file=thirdparty/mediapipe/graphs/face_mesh/face_mesh_desktop_live.pbtxt --input-video-path=test.mp4
To test FaceMesh on video and save result as a video:
LD_LIBRARY_PATH=./lib/ cargo run --bin demo -- --calculator-graph-config-file=thirdparty/mediapipe/graphs/face_mesh/face_mesh_desktop_live.pbtxt --input-video-path=test.mp4 --output-video-path=out.mp4
LD_LIBRARY_PATH=./lib cargo test
- Make static link with
fmesh
library. - Make GPU-accelerated app.