AI-generated Key Takeaways
-
FaceMeshDetection is the entry point to get a FaceMeshDetector for finding FaceMeshs in an image.
-
A FaceMeshDetector can be obtained using getClient() with default options or getClient(FaceMeshDetectorOptions) with specified options.
-
To perform face mesh detection, you need to create an InputImage instance from various sources like Bitmap, ByteBuffer, or Image.
-
Once you have a FaceMeshDetector and an InputImage, you can use the process() method to detect face meshes.
-
Remember to call FaceMeshDetector.close() to release resources when the detector is no longer needed.
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();
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);
InputImage
.
Task<List<FaceMesh>> task = faceMeshDetector.process(image);
task.addOnSuccessListener(...).addOnFailureListener(...);
Public Method Summary
static FaceMeshDetector |
getClient()
Gets an instance of
FaceMeshDetector
that detects face mesh in a supplied image with a default
FaceMeshDetectorOptions .
|
static FaceMeshDetector |
getClient(FaceMeshDetectorOptions
options)
Gets a new instance of
FaceMeshDetector
that detects face mesh in a supplied image.
|
Inherited Method Summary
Public Methods
public static FaceMeshDetector 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 getClient (FaceMeshDetectorOptions 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 |
---|