AccuratePoseDetectorOptions.Builder

  • AccuratePoseDetectorOptions.Builder helps configure settings for accurate pose detection in images and video streams.

  • It allows setting the detector mode (single image or stream), customizing the executor, and specifying preferred hardware configurations.

  • The builder provides methods like setDetectorMode, setExecutor, and setPreferredHardwareConfigs to adjust the detection process.

  • By default, it uses stream mode and an internal background thread pool for processing.

  • After configuration, call the build() method to create an AccuratePoseDetectorOptions instance for use with the pose detector.

public static class AccuratePoseDetectorOptions.Builder extends Object

Public Constructor Summary

Public Method Summary

AccuratePoseDetectorOptions
AccuratePoseDetectorOptions.Builder
setDetectorMode(int detectorMode)
Set the detector mode to be used, depending on what kind of input is being processed.
AccuratePoseDetectorOptions.Builder
setExecutor(Executor executor)
Sets the custom Executor to use.
AccuratePoseDetectorOptions.Builder
setPreferredHardwareConfigs(int config, int... moreConfigs)

Inherited Method Summary

Public Constructors

public Builder ()

Public Methods

public AccuratePoseDetectorOptions.Builder setDetectorMode (int detectorMode)

Set the detector mode to be used, depending on what kind of input is being processed. The PoseDetector.process(InputImage) and PoseDetector.process(MlImage) call will treat the inputs differently based on this mode.

Default: PoseDetectorOptionsBase.STREAM_MODE

Use PoseDetectorOptionsBase.STREAM_MODE for input frames consisting of related images, for example, frames from a user's camera. This mode uses tracking, which provides a speed-up when the frames consists of related images without much of a scene change.

Use PoseDetectorOptionsBase.SINGLE_IMAGE_MODE for a single still image, or when the input frames are unrelated.

Parameters
detectorMode the detector mode used, depending on what kind of input is being processed. One of PoseDetectorOptionsBase.STREAM_MODE or PoseDetectorOptionsBase.SINGLE_IMAGE_MODE.

public AccuratePoseDetectorOptions.Builder setExecutor (Executor executor)

Sets the custom Executor to use. If no Executor is set, an internal background thread pool will be used.

Most clients should not need to call this method.

public AccuratePoseDetectorOptions.Builder setPreferredHardwareConfigs (int config, int... moreConfigs)

Sets preferred PoseDetectorOptionsBase.HardwareConfigs.

Available options: PoseDetectorOptionsBase.CPU, PoseDetectorOptionsBase.CPU_GPU.

ML Kit will take availability, stability, correctness and latency of each config into consideration and pick the best one from the preferred configs. If none of the preferred configs is applicable, the default CPU config will be used automatically as fallback.

Example usages: