/mediapipe

Cross-platform, customizable ML solutions for live and streaming media.

Primary LanguageC++Apache License 2.0Apache-2.0

layout title nav_order
default
Home
1

MediaPipe


Live ML anywhere

MediaPipe offers cross-platform, customizable ML solutions for live and streaming media.

accelerated.png cross_platform.png
End-to-End acceleration: Built-in fast ML inference and processing accelerated even on common hardware Build once, deploy anywhere: Unified solution works across Android, iOS, desktop/cloud, web and IoT
ready_to_use.png open_source.png
Ready-to-use solutions: Cutting-edge ML solutions demonstrating full power of the framework Free and open source: Framework and solutions both under Apache 2.0, fully extensible and customizable

ML solutions in MediaPipe

Face Detection Face Mesh Iris Hands Pose Holistic
face_detection face_mesh iris hand pose hair_segmentation
Hair Segmentation Object Detection Box Tracking Instant Motion Tracking Objectron KNIFT
hair_segmentation object_detection box_tracking instant_motion_tracking objectron knift
Android iOS C++ Python JS Coral
Face Detection
Face Mesh
Iris
Hands
Pose
Holistic
Selfie Segmentation
Hair Segmentation
Object Detection
Box Tracking
Instant Motion Tracking
Objectron
KNIFT
AutoFlip
MediaSequence
YouTube 8M

See also MediaPipe Models and Model Cards for ML models released in MediaPipe.

Getting started

To start using MediaPipe solutions with only a few lines code, see example code and demos in MediaPipe in Python and MediaPipe in JavaScript.

To use MediaPipe in C++, Android and iOS, which allow further customization of the solutions as well as building your own, learn how to install MediaPipe and start building example applications in C++, Android and iOS.

The source code is hosted in the MediaPipe Github repository, and you can run code search using Google Open Source Code Search.

Build on MacOS

Prepare

  1. install bazel/opencv/ffmpeg:
brew install bazel
brew install opencv@3
brew install ffmpeg
  1. Set .bazelversion: Run
brew list bazel

to get bazel version, which may print:

/opt/homebrew/Cellar/bazel/4.1.0/bin/bazel
/opt/homebrew/Cellar/bazel/4.1.0/bin/bazel-4.1.0
/opt/homebrew/Cellar/bazel/4.1.0/etc/bash_completion.d/bazel-complete.bash
/opt/homebrew/Cellar/bazel/4.1.0/libexec/bin/ (3 files)
/opt/homebrew/Cellar/bazel/4.1.0/share/zsh/site-functions/_bazel```

Update .bazelversion:

echo 4.1.0 > .bazelversion
  1. Set the right paths to opencv/ffmpeg in WORKSPACE (line 212~222), for example:
new_local_repository(
    name = "macos_opencv",
    build_file = "@//third_party:opencv_macos.BUILD",
    path = "/opt/homebrew/Cellar/opencv@3/3.4.14_3",
)

new_local_repository(
    name = "macos_ffmpeg",
    build_file = "@//third_party:ffmpeg_macos.BUILD",
    path = "/opt/homebrew/Cellar/ffmpeg/4.4_2",
)

CPU: Apple Silicon M1

  1. Build "hello_world":
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --cpu darwin_arm64 mediapipe/examples/desktop/hello_world:hello_world

and run:

export GLOG_logtostderr=1
bazel-bin/mediapipe/examples/desktop/hello_world/hello_world
  1. Build all available examples under mediapipe/examples/desktop:
bash build_macos_desktop_examples.sh --cpu m1 -b
  1. Build and run one example app (e.g. mediapipe/examples/desktop/face_detection):
bash build_macos_desktop_examples.sh --cpu m1 --app face_detection -r

CPU: x86_64

  1. Build "hello_world":
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --cpu darwin_x86_64 mediapipe/examples/desktop/hello_world:hello_world

and run:

export GLOG_logtostderr=1
bazel-bin/mediapipe/examples/desktop/hello_world/hello_world
  1. Build all available examples under mediapipe/examples/desktop:
bash build_macos_desktop_examples.sh --cpu x86_64 -b
  1. Build and run one example app (e.g. mediapipe/examples/desktop/face_detection):
bash build_macos_desktop_examples.sh --cpu x86_64 --app face_detection -r

CPU: i386

  1. Build "hello_world":
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --cpu darwin_i386 mediapipe/examples/desktop/hello_world:hello_world

and run:

export GLOG_logtostderr=1
bazel-bin/mediapipe/examples/desktop/hello_world/hello_world
  1. Build all available examples under mediapipe/examples/desktop:
bash build_macos_desktop_examples.sh --cpu i386 -b
  1. Build and run one example app (e.g. mediapipe/examples/desktop/face_detection):
bash build_macos_desktop_examples.sh --cpu i386 --app face_detection -r

Publications

Videos

Events

Community

Alpha disclaimer

MediaPipe is currently in alpha at v0.7. We may be still making breaking API changes and expect to get to stable APIs by v1.0.

Contributing

We welcome contributions. Please follow these guidelines.

We use GitHub issues for tracking requests and bugs. Please post questions to the MediaPipe Stack Overflow with a mediapipe tag.