HandLandmarker.HandLandmarkerOptions.Builder

public abstract class HandLandmarker.HandLandmarkerOptions.Builder


Builder for HandLandmarkerOptions.

Summary

Public constructors

Public methods

final HandLandmarker.HandLandmarkerOptions

Validates and builds the HandLandmarkerOptions instance.

abstract HandLandmarker.HandLandmarkerOptions.Builder

Sets the base options for the hand landmarker task.

abstract HandLandmarker.HandLandmarkerOptions.Builder

Sets an optional error listener.

abstract HandLandmarker.HandLandmarkerOptions.Builder

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

abstract HandLandmarker.HandLandmarkerOptions.Builder

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

abstract HandLandmarker.HandLandmarkerOptions.Builder

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

abstract HandLandmarker.HandLandmarkerOptions.Builder

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

abstract HandLandmarker.HandLandmarkerOptions.Builder

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

abstract HandLandmarker.HandLandmarkerOptions.Builder

Sets the running mode for the hand landmarker task.

Public constructors

Builder

public Builder()

Public methods

build

public final HandLandmarker.HandLandmarkerOptions build()

Validates and builds the HandLandmarkerOptions 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 hand landmarker is in the live stream mode.

setBaseOptions

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

Sets the base options for the hand landmarker task.

setErrorListener

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

Sets an optional error listener.

setMinHandDetectionConfidence

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

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

setMinHandPresenceConfidence

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

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

setMinTrackingConfidence

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

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

setNumHands

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

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

setResultListener

public abstract HandLandmarker.HandLandmarkerOptions.Builder setResultListener(
    OutputHandler.ResultListener<HandLandmarkerResult, MPImage> value
)

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

setRunningMode

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.