CustomObjectDetectorOptions.Builder

public static class CustomObjectDetectorOptions.Builder extends Object

Public Constructor Summary

CustomObjectDetectorOptions.Builder(LocalModel localModel)

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
setDetectorMode(int detectorMode)
Sets the DetectorMode, which contains two modes, STREAM_MODE and SINGLE_IMAGE_MODE.
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 CustomObjectDetectorOptions.Builder (LocalModel localModel)

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 setDetectorMode (int detectorMode)

Sets the DetectorMode, which contains two modes, STREAM_MODE and SINGLE_IMAGE_MODE. For more details, please see comments for STREAM_MODE and SINGLE_IMAGE_MODE.

By default, it is STREAM_MODE.

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.