# CustomImageLabelerOptions.Builder

public static class **CustomImageLabelerOptions.Builder** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
Builder of `https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions`.

### Public Constructor Summary

|---|---|
|   | [Builder](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder#Builder(com.google.mlkit.common.model.LocalModel))(LocalModel localModel) Creates a new builder to build `https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions` with `https://developers.google.com/android/reference/com/google/mlkit/common/model/LocalModel`. |
|   | [Builder](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder#Builder(com.google.mlkit.common.model.CustomRemoteModel))(CustomRemoteModel remoteModel) Creates a new builder to build `https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions` with `https://developers.google.com/android/reference/com/google/mlkit/common/model/CustomRemoteModel`. |

### Public Method Summary

|---|---|
| [CustomImageLabelerOptions](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions) | [build](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder#build())() |
| [CustomImageLabelerOptions.Builder](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder) | [setConfidenceThreshold](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder#setConfidenceThreshold(float))(float confidenceThreshold) Sets confidence threshold of detected labels. |
| [CustomImageLabelerOptions.Builder](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder) | [setExecutor](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder#setExecutor(java.util.concurrent.Executor))([Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html) executor) Sets the custom `https://developer.android.com/reference/java/util/concurrent/Executor.html` to use. |
| [CustomImageLabelerOptions.Builder](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder) | [setMaxResultCount](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder#setMaxResultCount(int))(int maxResultCount) Sets the maximum number of results that the image labeler will return. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Constructors

#### public **Builder** (LocalModel localModel)

Creates a new builder to build `https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions` with `https://developers.google.com/android/reference/com/google/mlkit/common/model/LocalModel`.

#### public **Builder** (CustomRemoteModel remoteModel)

Creates a new builder to build `https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions` with `https://developers.google.com/android/reference/com/google/mlkit/common/model/CustomRemoteModel`.

## Public Methods

#### public [CustomImageLabelerOptions](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions)
**build** ()

#### public [CustomImageLabelerOptions.Builder](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/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](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | if the `confidenceThreshold` is out of the range \[0.0f, 1.0f\]. |
|---|---|

#### public [CustomImageLabelerOptions.Builder](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder) **setExecutor** ([Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html) executor)

Sets the custom `https://developer.android.com/reference/java/util/concurrent/Executor.html`
to use. If no `https://developer.android.com/reference/java/util/concurrent/Executor.html`
is set, an internal background thread pool will be used.

Most clients should not need to call this method.

##### Parameters

| executor | the `https://developer.android.com/reference/java/util/concurrent/Executor.html` to use |
|---|---|

##### Returns

- this object, for chaining method calls

#### public [CustomImageLabelerOptions.Builder](https://developers.google.com/android/reference/com/google/mlkit/vision/label/custom/CustomImageLabelerOptions.Builder) **setMaxResultCount** (int maxResultCount)

Sets the maximum number of results that the image labeler will return.