Attention: This MediaPipe Solutions Preview is an early release. Learn more.

BaseOptions.Builder

Stay organized with collections Save and categorize content based on your preferences.
public static abstract class BaseOptions.Builder

Builder for BaseOptions.

Public Constructors

Public Methods

final BaseOptions
build()
Validates and builds the BaseOptions instance.
abstract BaseOptions.Builder
setDelegate(Delegate delegate)
Sets device delegate to run the MediaPipe pipeline.
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).
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).
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.

Inherited Methods

Public Constructors

public Builder ()

Public Methods

public final BaseOptions build ()

Validates and builds the BaseOptions instance.

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

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.

Parameters
delegate

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.

Parameters
value

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.

Parameters
value

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.

Parameters
value