BaseOptions.Builder

public abstract class BaseOptions.Builder


Builder for BaseOptions.

Summary

Public constructors

Public methods

final BaseOptions

Validates and builds the BaseOptions instance.

abstract BaseOptions.Builder

Sets device delegate to run the MediaPipe pipeline.

abstract BaseOptions.Builder

Options for the chosen delegate.

abstract BaseOptions.Builder

Sets either the direct ByteBuffer or the MappedByteBuffer of a model asset file (a tflite model or a model asset bundle file).

abstract BaseOptions.Builder

Sets the native fd int of a model asset file (a tflite model or a model asset bundle file).

abstract BaseOptions.Builder

Sets the model path to a model asset file (a tflite model or a model asset bundle file) in the Android app assets folder.

Public constructors

Builder

public Builder()

Public methods

build

public final BaseOptions build()

Validates and builds the BaseOptions instance.

Throws
java.lang.IllegalArgumentException

if BaseOptions is invalid, or the provided model buffer is not a direct ByteBuffer or a MappedByteBuffer.

setDelegate

public abstract BaseOptions.Builder setDelegate(Delegate delegate)

Sets device delegate to run the MediaPipe pipeline. If the delegate is not set, the default delegate CPU is used.

setDelegateOptions

public abstract BaseOptions.Builder setDelegateOptions(BaseOptions.DelegateOptions delegateOptions)

Options for the chosen delegate. If not set, the default delegate options is used.

setModelAssetBuffer

public abstract BaseOptions.Builder setModelAssetBuffer(ByteBuffer value)

Sets either the direct ByteBuffer or the MappedByteBuffer of a model asset file (a tflite model or a model asset bundle file).

Note: when model buffer is set, both model file and model file descriptor should be empty.

setModelAssetFileDescriptor

public abstract BaseOptions.Builder setModelAssetFileDescriptor(Integer value)

Sets the native fd int of a model asset file (a tflite model or a model asset bundle file).

Note: when model file descriptor is set, both model path and model buffer should be empty.

setModelAssetPath

public abstract BaseOptions.Builder setModelAssetPath(String value)

Sets the model path to a model asset file (a tflite model or a model asset bundle file) in the Android app assets folder.

Note: when model path is set, both model file descriptor and model buffer should be empty.