Builder for SelfieSegmenterOptions
.
Public Constructor Summary
Builder()
|
Public Method Summary
SelfieSegmenterOptions |
build()
|
SelfieSegmenterOptions.Builder |
enableRawSizeMask()
Asks the segmenter to return the raw size mask which matches the model output
size.
|
SelfieSegmenterOptions.Builder |
setDetectorMode(int detectorMode)
Sets the detector mode to be either
SelfieSegmenterOptions.STREAM_MODE or
SelfieSegmenterOptions.SINGLE_IMAGE_MODE .
|
SelfieSegmenterOptions.Builder |
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
.