SelfieSegmenterOptions.Builder

Stay organized with collections Save and categorize content based on your preferences.
public static class SelfieSegmenterOptions.Builder extends Object

Builder for SelfieSegmenterOptions.

Public Constructor Summary

Public Method Summary

SelfieSegmenterOptions
SelfieSegmenterOptions.Builder
enableRawSizeMask()
Asks the segmenter to return the raw size mask which matches the model output size.
SelfieSegmenterOptions.Builder
SelfieSegmenterOptions.Builder
setExecutor(Executor executor)
Sets the custom Executor to use.

Inherited Method Summary

Public Constructors

public Builder ()

Public Methods

public SelfieSegmenterOptions build ()

public SelfieSegmenterOptions.Builder enableRawSizeMask ()

Asks the segmenter to return the raw size mask which matches the model output size.

The raw mask size (e.g. 256x256) is usually smaller than the InputImage size. Please call SegmentationMask.getWidth() and SegmentationMask.getHeight() to get the size when enabling this option.

Without specifying this option, the segmenter will rescale the raw mask to match the input image size. Consider using this option if you want to apply customized rescaling logic or rescaling is not needed for your use case.

public SelfieSegmenterOptions.Builder setDetectorMode (int detectorMode)

Sets the detector mode to be either SelfieSegmenterOptions.STREAM_MODE or SelfieSegmenterOptions.SINGLE_IMAGE_MODE.

By default, it is SelfieSegmenterOptions.STREAM_MODE.

For more details about use cases of each mode, please check the documentation of SelfieSegmenterOptions.STREAM_MODE and SelfieSegmenterOptions.SINGLE_IMAGE_MODE.

public SelfieSegmenterOptions.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.