CustomObjectDetectorOptions.Builder

public static class CustomObjectDetectorOptions.Builder extends Object

Public Constructor Summary

Builder(LocalModel localModel)
Creates a new builder to build CustomObjectDetectorOptions with LocalModel.
Builder(CustomRemoteModel remoteModel)
Creates a new builder to build CustomObjectDetectorOptions with CustomRemoteModel.

Public Method Summary

CustomObjectDetectorOptions
CustomObjectDetectorOptions.Builder
enableClassification()
Enables classification.
CustomObjectDetectorOptions.Builder
enableMultipleObjects()
Enables multiple objects for detection.
CustomObjectDetectorOptions.Builder
setClassificationConfidenceThreshold(float classificationConfidenceThreshold)
Sets the classification confidence threshold of labels to be detected.
CustomObjectDetectorOptions.Builder
CustomObjectDetectorOptions.Builder
setExecutor(Executor executor)
Sets the custom Executor to use.
CustomObjectDetectorOptions.Builder
setMaxPerObjectLabelCount(int maxPerObjectLabelCount)
Sets the maximum number of labels per object that the detector will return.

Inherited Method Summary

Public Constructors

public Builder (LocalModel localModel)

Creates a new builder to build CustomObjectDetectorOptions with LocalModel.

public Builder (CustomRemoteModel remoteModel)

Creates a new builder to build CustomObjectDetectorOptions with CustomRemoteModel.

Public Methods

public CustomObjectDetectorOptions.Builder enableClassification ()

Enables classification.

By default, the classification is off.

public CustomObjectDetectorOptions.Builder enableMultipleObjects ()

Enables multiple objects for detection.

When enabled, the maximum number of detected objects per image is 5.

By default, the detector detects prominent object only.

public CustomObjectDetectorOptions.Builder setClassificationConfidenceThreshold (float classificationConfidenceThreshold)

Sets the classification confidence threshold of labels to be detected.

If not set, any classifier threshold specified by the model’s metadata will be used, or 0.0 will be used if no such metadata or threshold.

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

Parameters
executor the Executor to use
Returns
  • this object, for chaining method calls

public CustomObjectDetectorOptions.Builder setMaxPerObjectLabelCount (int maxPerObjectLabelCount)

Sets the maximum number of labels per object that the detector will return.

If not set, the default value of 10 will be used.