Back to Tensorflow

ImageSegmenter.ImageSegmenterOptions.Builder

tensorflow/lite/g3doc/api_docs/java/org/tensorflow/lite/task/vision/segmenter/ImageSegmenter.ImageSegmenterOptions.Builder.html

2.21.05.5 KB
Original Source

public static abstract class ImageSegmenter.ImageSegmenterOptions.Builder

Builder for ImageSegmenter.ImageSegmenterOptions.

Public Constructors

| | Builder() |

Public Methods

| abstract ImageSegmenter.ImageSegmenterOptions | build() | | abstract ImageSegmenter.ImageSegmenterOptions.Builder | setBaseOptions(BaseOptions baseOptions) Sets the general options to configure Task APIs, such as accelerators.

| | abstract ImageSegmenter.ImageSegmenterOptions.Builder | setDisplayNamesLocale(String displayNamesLocale) Sets the locale to use for display names specified through the TFLite Model Metadata, if any.

| | abstract ImageSegmenter.ImageSegmenterOptions.Builder | setNumThreads(int numThreads) This method is deprecated. use BaseOptions to configure number of threads instead. This method will override the number of threads configured from BaseOptions.

| | abstract ImageSegmenter.ImageSegmenterOptions.Builder | setOutputType(OutputType outputType) |

Inherited Methods

From class java.lang.Object

| boolean | equals(Object arg0) | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

Public Constructors

public Builder ()

Public Methods

public abstract ImageSegmenter.ImageSegmenterOptions build ()

public abstract ImageSegmenter.ImageSegmenterOptions.Builder setBaseOptions (BaseOptions baseOptions)

Sets the general options to configure Task APIs, such as accelerators.

Parameters

| baseOptions | |

public abstract ImageSegmenter.ImageSegmenterOptions.Builder setDisplayNamesLocale (String displayNamesLocale)

Sets the locale to use for display names specified through the TFLite Model Metadata, if any.

Defaults to English("en"). See the TFLite Metadata schema file. for the accepted pattern of locale.

Parameters

| displayNamesLocale | |

public abstract ImageSegmenter.ImageSegmenterOptions.Builder setNumThreads (int numThreads)

This method is deprecated.
use BaseOptions to configure number of threads instead. This method will override the number of threads configured from BaseOptions.

Sets the number of threads to be used for TFLite ops that support multi-threading when running inference with CPU. Defaults to -1.

numThreads should be greater than 0 or equal to -1. Setting numThreads to -1 has the effect to let TFLite runtime set the value.

Parameters

| numThreads | |

public abstract ImageSegmenter.ImageSegmenterOptions.Builder setOutputType (OutputType outputType)

Parameters

| outputType | |