AI-generated Key Takeaways
-
CustomImageLabelerOptions.Builder
helps configure custom image labeling using local or remote models. -
It allows setting the confidence threshold for detected labels, influencing which labels are returned.
-
Developers can specify a custom
Executor
for task processing or rely on the internal thread pool. -
The maximum number of labels returned by the image labeler can be controlled using
setMaxResultCount
.
Builder of CustomImageLabelerOptions
.
Public Constructor Summary
Builder(LocalModel localModel)
Creates a new builder to build
CustomImageLabelerOptions with LocalModel .
|
|
Builder(CustomRemoteModel remoteModel)
Creates a new builder to build
CustomImageLabelerOptions with CustomRemoteModel .
|
Public Method Summary
CustomImageLabelerOptions |
build()
|
CustomImageLabelerOptions.Builder |
setConfidenceThreshold(float confidenceThreshold)
Sets confidence threshold of detected labels.
|
CustomImageLabelerOptions.Builder | |
CustomImageLabelerOptions.Builder |
setMaxResultCount(int maxResultCount)
Sets the maximum number of results that the image labeler will return.
|
Inherited Method Summary
Public Constructors
public Builder (LocalModel localModel)
Creates a new builder to build
CustomImageLabelerOptions
with LocalModel
.
public Builder (CustomRemoteModel remoteModel)
Creates a new builder to build
CustomImageLabelerOptions
with CustomRemoteModel
.
Public Methods
public CustomImageLabelerOptions build ()
public CustomImageLabelerOptions.Builder setConfidenceThreshold (float confidenceThreshold)
Sets confidence threshold of detected labels. Only labels detected with confidence higher than this threshold are returned.
The default value will be read from model metadata. If not presented, will use 0.
Throws
IllegalArgumentException | if the confidenceThreshold is out of the range [0.0f, 1.0f]. |
---|
public CustomImageLabelerOptions.Builder setExecutor (Executor executor)
public CustomImageLabelerOptions.Builder setMaxResultCount (int maxResultCount)
Sets the maximum number of results that the image labeler will return.