Rust and mediapipe
Go to file
2022-06-20 22:15:01 -07:00
examples fix holistic tracking with singular feature types 2022-06-20 22:15:01 -07:00
src fix holistic tracking with singular feature types 2022-06-20 22:15:01 -07:00
.gitignore fix holistic tracking with singular feature types 2022-06-20 22:15:01 -07:00
build.rs update build script 2022-06-12 17:26:27 -07:00
Cargo.toml remmove cxx and update readme 2022-06-15 13:01:42 -07:00
LICENSE Initial commit 2022-02-13 21:36:11 +07:00
mediapipe fix holistic tracking with singular feature types 2022-06-20 22:15:01 -07:00
README.md git ignore mediapipe and update readme to use symlink 2022-06-20 19:56:13 -07:00

mediapipe-rs

Simple rust bindings for mediapipe.

Forked from: https://github.com/angular-rust/ux-mediapipe 🙏

And heavily based on this example: https://github.com/asprecic/mediapipe-qt-integration-example 🤌

requirements

setup

Mediapipe is a framework for building AI-powered computer vision applications. It provides high level libraries exposing some of its solutions for common problems. This package makes some of these solutions available in Rust. In order to use it we must build a custom mediapipe C++ library.

Clone the modified Mediapipe repo.

git clone https://github.com/julesyoungberg/mediapipe.git
cd mediapipe

Build & install the mediagraph library.

mac os

bazel build --define MEDIAPIPE_DISABLE_GPU=1 mediapipe:libmediagraph.dylib
sudo cp bazel-bin/mediapipe/libmediagraph.dylib /usr/local/lib/libmediagraph.dylib
cp mediapipe/mediagraph.h /usr/local/include/mediagraph.h

linux (untested)

bazel build --define MEDIAPIPE_DISABLE_GPU=1 mediapipe:mediagraph
cp bazel-bin/mediapipe/libmediagraph.so /usr/local/lib/libmediagraph.so
cp mediapipe/mediagraph.h /usr/local/include/mediagraph.h

usage

Add the following to your dependencies list in Cargo.toml:

mediapipe = { git = "https://github.com/julesyoungberg/mediapipe-rs" }

Mediapipe relies on tflite files which must be available at ./mediapipe/modules/. The easiest way to satisfy this is by creating a symbolic link to mediapipe. Run the following command from the project directory.

ln -s ../mediapipe/mediapipe .

The path to mediapipe may be different depending on where you have cloned it to.

examples

Examples are located in the ./examples directory. Run face_mesh.rs with

cargo run --release --example face_mesh