# PoseDetection

public class **PoseDetection** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
Entry point to get a `PoseDetector`
for finding `Pose` in a supplied
image.

A `PoseDetector`
is created via `
getClient(PoseDetectorOptionsBase)`. For example:

     PoseDetector poseDetector = PoseDetection.getClient(options); 

To perform pose detection in an image, you first need to create an instance of `InputImage` from a `Bitmap`, `ByteBuffer`, `Image` etc. See `InputImage` documentation for more details. For example, the code below creates an `InputImage` from a `Bitmap`.

     InputImage image = InputImage.fromBitmap(bitmap, rotationDegrees); 

Then the code below can detect `
Pose` in the supplied `InputImage`.

     Task<Pose> task = poseDetector.process(image);
     task.addOnSuccessListener(...).addOnFailureListener(...); 

### Public Method Summary

|---|---|
| static [PoseDetector](https://developers.google.com/android/reference/com/google/mlkit/vision/pose/PoseDetector.md.txt) | [getClient](https://developers.google.com/android/reference/com/google/mlkit/vision/pose/PoseDetection.md.txt#getClient(com.google.mlkit.vision.pose.PoseDetectorOptionsBase))([PoseDetectorOptionsBase](https://developers.google.com/android/reference/com/google/mlkit/vision/pose/PoseDetectorOptionsBase.md.txt) options) Creates an instance of `PoseDetector` that detects human body pose in a supplied image. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public static [PoseDetector](https://developers.google.com/android/reference/com/google/mlkit/vision/pose/PoseDetector.md.txt)
**getClient** ([PoseDetectorOptionsBase](https://developers.google.com/android/reference/com/google/mlkit/vision/pose/PoseDetectorOptionsBase.md.txt) options)

Creates an instance of `PoseDetector`
that detects human body pose in a supplied image.

To release the resources associated with a `PoseDetector`,
you need to ensure that `PoseDetector.close()`
is called on the resulting `PoseDetector`
instance once it will no longer be used.

Detector initialization work is triggered in the background when the `PoseDetector`
instance is created. Optionally, you can use the `PoseDetector.getInitTask()`
to track the initialization progress. The first `
PoseDetector.process(InputImage)` or `
PoseDetector.process(MlImage)` call will wait for the initialization to be
finished.