FaceLandmarker.FaceLandmarkerOptions.Builder

public abstract class FaceLandmarker.FaceLandmarkerOptions.Builder


Builder for FaceLandmarkerOptions.

Summary

Public constructors

Public methods

final FaceLandmarker.FaceLandmarkerOptions

Validates and builds the FaceLandmarkerOptions instance.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Sets the base options for the face landmarker task.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Sets an optional error listener.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Sets minimum confidence score for the face detection to be considered successful

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Sets minimum confidence score of face presence score in the face landmark detection.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Sets the minimum confidence score for the face tracking to be considered successful.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Sets the maximum number of faces can be detected by the FaceLandmarker.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setOutputFaceBlendshapes(boolean value)

Whether FaceLandmarker outputs face blendshapes classification.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Whether FaceLandmarker outptus facial transformation_matrix.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Sets the result listener to receive the detection results asynchronously when the face landmarker is in the live stream mode.

abstract FaceLandmarker.FaceLandmarkerOptions.Builder

Sets the running mode for the face landmarker task.

Public constructors

Builder

public Builder()

Public methods

build

public final FaceLandmarker.FaceLandmarkerOptions build()

Validates and builds the FaceLandmarkerOptions instance.

Throws
java.lang.IllegalArgumentException

if the result listener and the running mode are not properly configured. The result listener should only be set when the face landmarker is in the live stream mode.

setBaseOptions

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setBaseOptions(BaseOptions value)

Sets the base options for the face landmarker task.

setErrorListener

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setErrorListener(ErrorListener value)

Sets an optional error listener.

setMinFaceDetectionConfidence

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setMinFaceDetectionConfidence(Float value)

Sets minimum confidence score for the face detection to be considered successful

setMinFacePresenceConfidence

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setMinFacePresenceConfidence(Float value)

Sets minimum confidence score of face presence score in the face landmark detection.

setMinTrackingConfidence

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setMinTrackingConfidence(Float value)

Sets the minimum confidence score for the face tracking to be considered successful.

setNumFaces

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setNumFaces(Integer value)

Sets the maximum number of faces can be detected by the FaceLandmarker.

setOutputFaceBlendshapes

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setOutputFaceBlendshapes(boolean value)

Whether FaceLandmarker outputs face blendshapes classification. Face blendshapes are used for rendering the 3D face model.

Note: *Left and *Right blendshapes correspond to the subject's face, not the viewer. Passing a horizontally mirrored image will invert these outputs.

setOutputFacialTransformationMatrixes

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setOutputFacialTransformationMatrixes(boolean value)

Whether FaceLandmarker outptus facial transformation_matrix. Facial transformation matrix is used to transform the face landmarks in canonical face to the detected face, so that users can apply face effects on the detected landmarks.

setResultListener

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setResultListener(
    OutputHandler.ResultListener<FaceLandmarkerResult, MPImage> value
)

Sets the result listener to receive the detection results asynchronously when the face landmarker is in the live stream mode.

setRunningMode

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setRunningMode(RunningMode value)

Sets the running mode for the face landmarker task. Default to the image mode. Hand landmarker has three modes:

  • IMAGE: The mode for detecting face landmarks on single image inputs.
  • VIDEO: The mode for detecting face landmarks on the decoded frames of a video.
  • LIVE_STREAM: The mode for for detecting face landmarks on a live stream of input data, such as from camera. In this mode, setResultListener must be called to set up a listener to receive the detection results asynchronously.