FaceLandmarker.FaceLandmarkerOptions.Builder

public static abstract class FaceLandmarker.FaceLandmarkerOptions.Builder

Public Constructors

Public Methods

final FaceLandmarker.FaceLandmarkerOptions
build()
Validates and builds the FaceLandmarker.FaceLandmarkerOptions instance.
abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setBaseOptions(BaseOptions value)
Sets the base options for the face landmarker task.
abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setErrorListener(ErrorListener value)
Sets an optional error listener.
abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setMinFaceDetectionConfidence(Float value)
Sets minimum confidence score for the face detection to be considered successful
abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setMinFacePresenceConfidence(Float value)
Sets minimum confidence score of face presence score in the face landmark detection.
abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setMinTrackingConfidence(Float value)
Sets the minimum confidence score for the face tracking to be considered successful.
abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setNumFaces(Integer value)
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
setOutputFacialTransformationMatrixes(Boolean value)
Whether FaceLandmarker outptus facial transformation_matrix.
abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setResultListener(ResultListener<FaceLandmarkerResultMPImage> value)
Sets the result listener to receive the detection results asynchronously when the face landmarker is in the live stream mode.
abstract FaceLandmarker.FaceLandmarkerOptions.Builder
setRunningMode(RunningMode value)
Sets the running mode for the face landmarker task.

Inherited Methods

Public Constructors

public Builder ()

Public Methods

public final FaceLandmarker.FaceLandmarkerOptions build ()

Validates and builds the FaceLandmarker.FaceLandmarkerOptions instance.

Throws
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.

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

Sets the base options for the face landmarker task.

Parameters
value

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

Sets an optional error listener.

Parameters
value

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

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

Parameters
value

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

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

Parameters
value

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

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

Parameters
value

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

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

Parameters
value

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

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

Parameters
value

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.

Parameters
value

public abstract FaceLandmarker.FaceLandmarkerOptions.Builder setResultListener (ResultListener<FaceLandmarkerResultMPImage> value)

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

Parameters
value

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.

Parameters
value