Project import generated by Copybara.

GitOrigin-RevId: 412b20ea6bc8e49ba5b50798a6114ad6173ff073
This commit is contained in:
MediaPipe Team 2021-11-03 22:46:07 -07:00 committed by chuoling
parent d4bb35fe5a
commit f4e7f6cc48

View File

@ -1,28 +1,30 @@
--- ---
layout: default layout: default
title: Android Solutions title: MediaPipe Android Solutions
parent: MediaPipe on Android parent: MediaPipe on Android
grand_parent: Getting Started grand_parent: Getting Started
nav_order: 2 nav_order: 2
--- ---
# Android Solution APIs # MediaPipe Android Solutions
{: .no_toc } {: .no_toc }
1. TOC 1. TOC
{:toc} {:toc}
--- ---
Please follow instructions below to use the MediaPipe Solution APIs in Android MediaPipe Android Solution APIs (currently in alpha) are available in:
Studio projects and build the Android example apps in the supported MediaPipe
[solutions](../solutions/solutions.md).
## Integrate MediaPipe Android Solutions in Android Studio * [MediaPipe Face Detection](../solutions/face_detection#android-solution-api)
* [MediaPipe Face Mesh](../solutions/face_mesh#android-solution-api)
* [MediaPipe Hands](../solutions/hands#android-solution-api)
MediaPipe Android Solution APIs (currently in alpha) are now available in ## Incorporation in Android Studio
Prebuilt packages of Android Solution APIs can be found in
[Google's Maven Repository](https://maven.google.com/web/index.html?#com.google.mediapipe). [Google's Maven Repository](https://maven.google.com/web/index.html?#com.google.mediapipe).
To incorporate MediaPipe Android Solutions into an Android Studio project, add To incorporate them into an Android Studio project, add the following into the
the following into the project's Gradle dependencies: project's Gradle dependencies:
``` ```
dependencies { dependencies {
@ -47,14 +49,17 @@ dependencies {
} }
``` ```
See the detailed solution APIs usage examples for different use cases in the If you need further customization, instead of using the prebuilt maven packages
solution example apps' consider building a MediaPipe Android Archive library locally from source by
[source code](https://github.com/google/mediapipe/tree/master/mediapipe/examples/android/solutions). following these [instructions](./android_archive_library.md).
If the prebuilt maven packages are not sufficient, building the MediaPipe
Android archive library locally by following these
[instructions](./android_archive_library.md).
## Build solution example apps in Android Studio ## Building solution example apps
Detailed usage examples of the Android Solution APIs can be found in the
[source code](https://github.com/google/mediapipe/tree/master/mediapipe/examples/android/solutions)
of the solution example apps.
To build these apps:
1. Open Android Studio Arctic Fox on Linux, macOS, or Windows. 1. Open Android Studio Arctic Fox on Linux, macOS, or Windows.
@ -75,7 +80,7 @@ Android archive library locally by following these
6. (Optional) Run solutions on CPU. 6. (Optional) Run solutions on CPU.
MediaPipe solution example apps run the pipeline and the model inference on MediaPipe solution example apps run the pipeline and model inference on GPU
GPU by default. If needed, for example to run the apps on Android Emulator, by default. If needed, for example to run the apps on Android Emulator, set
set the `RUN_ON_GPU` boolean variable to `false` in the app's the `RUN_ON_GPU` boolean variable to `false` in the app's
MainActivity.java to run the pipeline and the model inference on CPU. `MainActivity.java` to run the pipeline and model inference on CPU.