Skip to content

yevhen-k/face-mesh-rust

Repository files navigation

Demo of Mediapipe FaceMesh with Rust

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.

Quick Start

Requirements

  • bazel
  • opencv

Initialize Repo

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.

Start Rust Demo

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

Run Test

LD_LIBRARY_PATH=./lib cargo test

TODO

  1. Make static link with fmesh library.
  2. Make GPU-accelerated app.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published