Files
mediapipe/mediapipe/docs/examples.md
T
MediaPipe Team d68f5e4169 Project import generated by Copybara.
PiperOrigin-RevId: 253489161
2019-06-16 16:06:57 -07:00

2.9 KiB

Examples

Below are code samples on how to run MediaPipe on both mobile and desktop. We currently support MediaPipe APIs on mobile for Android only but will add support for Objective-C shortly.

Mobile

Hello World! on Android

Hello World! on Android should be the first mobile example users go through in detail. It teaches the following:

  • Introduction of a simple MediaPipe graph running on mobile GPUs for Sobel edge detection.
  • Building a simple baseline Android application that displays "Hello World!".
  • Adding camera preview support into the baseline application using the Android CameraX API.
  • Incorporating the Sobel edge detection graph to process the live camera preview and display the processed video in real-time.

Object Detection with GPU on Android

Object Detection on GPU on Android illustrates how to use MediaPipe with a TFLite model for object detection in a GPU-accelerated pipeline.

Object Detection with CPU on Android

Object Detection on CPU on Android illustrates using the same TFLite model in a CPU-based pipeline. This example highlights how graphs can be easily adapted to run on CPU v.s. GPU.

Face Detection on Android

Face Detection on Android illustrates how to use MediaPipe with a TFLite model for face detection in a GPU-accelerated pipeline.

Hair Segmentation on Android

Hair Segmentation on Android illustrates how to use MediaPipe with a TFLite model for hair segmentation in a GPU-accelerated pipeline.

Desktop

Hello World for C++

Hello World for C++ shows how to run a simple graph using the MediaPipe C++ APIs.

Preparing Data Sets with MediaSequence

Preparing Data Sets with MediaSequence shows how to use MediaPipe for media processing to prepare video data sets for training a TensorFlow model.

Object Detection on Desktop

Object Detection on Desktop shows how to run object detection models (TensorFlow and TFLite) using the MediaPipe C++ APIs.