FaceDetector.FaceDetectorOptions.Builder

public static abstract class FaceDetector.FaceDetectorOptions.Builder

Public Constructors

Public Methods

final FaceDetector.FaceDetectorOptions
build()
Validates and builds the FaceDetector.FaceDetectorOptions instance.
abstract FaceDetector.FaceDetectorOptions.Builder
setBaseOptions(BaseOptions value)
Sets the BaseOptions for the face detector task.
abstract FaceDetector.FaceDetectorOptions.Builder
setErrorListener(ErrorListener value)
Sets an optional ErrorListener}.
abstract FaceDetector.FaceDetectorOptions.Builder
setMinDetectionConfidence(Float value)
Sets the minimum confidence score for the face detection to be considered successful.
abstract FaceDetector.FaceDetectorOptions.Builder
setMinSuppressionThreshold(Float value)
Sets the minimum non-maximum-suppression threshold for face detection to be considered overlapped.
abstract FaceDetector.FaceDetectorOptions.Builder
setResultListener(ResultListener<FaceDetectorResultMPImage> value)
Sets the OutputHandler.ResultListener to receive the detection results asynchronously when the face detector is in the live stream mode.
abstract FaceDetector.FaceDetectorOptions.Builder
setRunningMode(RunningMode value)
Sets the RunningMode for the face detector task.

Inherited Methods

Public Constructors

public Builder ()

Public Methods

public final FaceDetector.FaceDetectorOptions build ()

Validates and builds the FaceDetector.FaceDetectorOptions 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 detector is in the live stream mode.

public abstract FaceDetector.FaceDetectorOptions.Builder setBaseOptions (BaseOptions value)

Sets the BaseOptions for the face detector task.

Parameters
value

public abstract FaceDetector.FaceDetectorOptions.Builder setErrorListener (ErrorListener value)

Sets an optional ErrorListener}.

Parameters
value

public abstract FaceDetector.FaceDetectorOptions.Builder setMinDetectionConfidence (Float value)

Sets the minimum confidence score for the face detection to be considered successful. The default minDetectionConfidence is 0.5.

Parameters
value

public abstract FaceDetector.FaceDetectorOptions.Builder setMinSuppressionThreshold (Float value)

Sets the minimum non-maximum-suppression threshold for face detection to be considered overlapped. The default minSuppressionThreshold is 0.3.

Parameters
value

public abstract FaceDetector.FaceDetectorOptions.Builder setResultListener (ResultListener<FaceDetectorResultMPImage> value)

Sets the OutputHandler.ResultListener to receive the detection results asynchronously when the face detector is in the live stream mode.

Parameters
value

public abstract FaceDetector.FaceDetectorOptions.Builder setRunningMode (RunningMode value)

Sets the RunningMode for the face detector task. Default to the image mode. face detector has three modes:

  • IMAGE: The mode for detecting faces on single image inputs.
  • VIDEO: The mode for detecting faces on the decoded frames of a video.
  • LIVE_STREAM: The mode for for detecting faces 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