# FaceMeshDetection

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

A `FaceMeshDetector`
is created via `
getClient(FaceMeshDetectorOptions)` or `getClient()`
if you wish to use the default options. For example, the code below creates a `FaceMeshDetector`
with default options.

    FaceMeshDetector faceMeshDetector = FaceMeshDetection.getClient();
     
To perform face mesh 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 face mesh in the supplied `InputImage`.

    Task<List<FaceMesh>> task = faceMeshDetector.process(image);
     task.addOnSuccessListener(...).addOnFailureListener(...);
     
### Public Method Summary

|---|---|
| static [FaceMeshDetector](https://developers.google.com/android/reference/com/google/mlkit/vision/facemesh/FaceMeshDetector.md.txt) | [getClient](https://developers.google.com/android/reference/com/google/mlkit/vision/facemesh/FaceMeshDetection.md.txt#getClient())() Gets an instance of `FaceMeshDetector` that detects face mesh in a supplied image with a default ` FaceMeshDetectorOptions`. |
| static [FaceMeshDetector](https://developers.google.com/android/reference/com/google/mlkit/vision/facemesh/FaceMeshDetector.md.txt) | [getClient](https://developers.google.com/android/reference/com/google/mlkit/vision/facemesh/FaceMeshDetection.md.txt#getClient(com.google.mlkit.vision.facemesh.FaceMeshDetectorOptions))([FaceMeshDetectorOptions](https://developers.google.com/android/reference/com/google/mlkit/vision/facemesh/FaceMeshDetectorOptions.md.txt) options) Gets a new instance of `FaceMeshDetector` that detects face mesh 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 [FaceMeshDetector](https://developers.google.com/android/reference/com/google/mlkit/vision/facemesh/FaceMeshDetector.md.txt)
**getClient** ()

Gets an instance of `FaceMeshDetector`
that detects face mesh in a supplied image with a default `FaceMeshDetectorOptions`.

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

#### public static [FaceMeshDetector](https://developers.google.com/android/reference/com/google/mlkit/vision/facemesh/FaceMeshDetector.md.txt)
**getClient** ([FaceMeshDetectorOptions](https://developers.google.com/android/reference/com/google/mlkit/vision/facemesh/FaceMeshDetectorOptions.md.txt) options)

Gets a new instance of `FaceMeshDetector`
that detects face mesh in a supplied image.

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

##### Parameters

| options | the options for the face mesh detector |
|---|---|