HandLandmarker.HandLandmarkerOptions.Builder

public static abstract class HandLandmarker.HandLandmarkerOptions.Builder

Public Constructors

Public Methods

final HandLandmarker.HandLandmarkerOptions
build()
Validates and builds the HandLandmarker.HandLandmarkerOptions instance.
abstract HandLandmarker.HandLandmarkerOptions.Builder
setBaseOptions(BaseOptions value)
Sets the base options for the hand landmarker task.
abstract HandLandmarker.HandLandmarkerOptions.Builder
setErrorListener(ErrorListener value)
Sets an optional error listener.
abstract HandLandmarker.HandLandmarkerOptions.Builder
setMinHandDetectionConfidence(Float value)
Sets minimum confidence score for the hand detection to be considered successful
abstract HandLandmarker.HandLandmarkerOptions.Builder
setMinHandPresenceConfidence(Float value)
Sets minimum confidence score of hand presence score in the hand landmark detection.
abstract HandLandmarker.HandLandmarkerOptions.Builder
setMinTrackingConfidence(Float value)
Sets the minimum confidence score for the hand tracking to be considered successful.
abstract HandLandmarker.HandLandmarkerOptions.Builder
setNumHands(Integer value)
Sets the maximum number of hands can be detected by the HandLandmarker.
abstract HandLandmarker.HandLandmarkerOptions.Builder
setResultListener(ResultListener<HandLandmarkerResultMPImage> value)
Sets the result listener to receive the detection results asynchronously when the hand landmarker is in the live stream mode.
abstract HandLandmarker.HandLandmarkerOptions.Builder
setRunningMode(RunningMode value)
Sets the running mode for the hand landmarker task.

Inherited Methods

Public Constructors

public Builder ()

Public Methods

public final HandLandmarker.HandLandmarkerOptions build ()

Validates and builds the HandLandmarker.HandLandmarkerOptions instance.

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

public abstract HandLandmarker.HandLandmarkerOptions.Builder setBaseOptions (BaseOptions value)

Sets the base options for the hand landmarker task.

Parameters
value

public abstract HandLandmarker.HandLandmarkerOptions.Builder setErrorListener (ErrorListener value)

Sets an optional error listener.

Parameters
value

public abstract HandLandmarker.HandLandmarkerOptions.Builder setMinHandDetectionConfidence (Float value)

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

Parameters
value

public abstract HandLandmarker.HandLandmarkerOptions.Builder setMinHandPresenceConfidence (Float value)

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

Parameters
value

public abstract HandLandmarker.HandLandmarkerOptions.Builder setMinTrackingConfidence (Float value)

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

Parameters
value

public abstract HandLandmarker.HandLandmarkerOptions.Builder setNumHands (Integer value)

Sets the maximum number of hands can be detected by the HandLandmarker.

Parameters
value

public abstract HandLandmarker.HandLandmarkerOptions.Builder setResultListener (ResultListener<HandLandmarkerResultMPImage> value)

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

Parameters
value

public abstract HandLandmarker.HandLandmarkerOptions.Builder setRunningMode (RunningMode value)

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

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