FaceLandmarker

public final class FaceLandmarker

Performs face landmarks detection on images.

This API expects a pre-trained face landmarks model asset bundle. See .

  • Input image MPImage
    • The image that face landmarks detection runs on.
  • Output FaceLandmarkerResult
    • A FaceLandmarkerResult containing face landmarks.

Nested Classes

class FaceLandmarker.FaceLandmarkerOptions Options for setting up an FaceLandmarker

Fields

public static final Set<Connection> FACE_LANDMARKS_CONNECTORS
public static final Set<Connection> FACE_LANDMARKS_FACE_OVAL
public static final Set<Connection> FACE_LANDMARKS_LEFT_EYE
public static final Set<Connection> FACE_LANDMARKS_LEFT_EYE_BROW
public static final Set<Connection> FACE_LANDMARKS_LEFT_IRIS
public static final Set<Connection> FACE_LANDMARKS_LIPS
public static final Set<Connection> FACE_LANDMARKS_RIGHT_EYE
public static final Set<Connection> FACE_LANDMARKS_RIGHT_EYE_BROW
public static final Set<Connection> FACE_LANDMARKS_RIGHT_IRIS
public static final Set<Connection> FACE_LANDMARKS_TESSELATION

Public Methods

static FaceLandmarker
createFromBuffer(Context context, ByteBuffer modelAssetBuffer)
Creates a FaceLandmarker instance from a model asset bundle buffer and the default FaceLandmarker.FaceLandmarkerOptions.
static FaceLandmarker
createFromFile(Context context, String modelAssetPath)
Creates a FaceLandmarker instance from a model asset bundle path and the default FaceLandmarker.FaceLandmarkerOptions.
static FaceLandmarker
createFromFile(Context context, File modelAssetFile)
Creates a FaceLandmarker instance from a model asset bundle file and the default FaceLandmarker.FaceLandmarkerOptions.
static FaceLandmarker
FaceLandmarkerResult
detect(MPImage image)
Performs face landmarks detection on the provided single image with default image processing options, i.e.
FaceLandmarkerResult
detect(MPImage image, ImageProcessingOptions imageProcessingOptions)
Performs face landmarks detection on the provided single image.
void
detectAsync(MPImage image, ImageProcessingOptions imageProcessingOptions, long timestampMs)
Sends live image data to perform face landmarks detection, and the results will be available via the OutputHandler.ResultListener provided in the FaceLandmarker.FaceLandmarkerOptions.
void
detectAsync(MPImage image, long timestampMs)
Sends live image data to perform face landmarks detection with default image processing options, i.e.
FaceLandmarkerResult
detectForVideo(MPImage image, ImageProcessingOptions imageProcessingOptions, long timestampMs)
Performs face landmarks detection on the provided video frame.
FaceLandmarkerResult
detectForVideo(MPImage image, long timestampMs)
Performs face landmarks detection on the provided video frame with default image processing options, i.e.

Inherited Methods

Fields

public static final Set<Connection> FACE_LANDMARKS_CONNECTORS

public static final Set<Connection> FACE_LANDMARKS_FACE_OVAL

public static final Set<Connection> FACE_LANDMARKS_LEFT_EYE

public static final Set<Connection> FACE_LANDMARKS_LEFT_EYE_BROW

public static final Set<Connection> FACE_LANDMARKS_LEFT_IRIS

public static final Set<Connection> FACE_LANDMARKS_LIPS

public static final Set<Connection> FACE_LANDMARKS_RIGHT_EYE

public static final Set<Connection> FACE_LANDMARKS_RIGHT_EYE_BROW