InterpreterFactory

class InterpreterFactory

Factory for constructing InterpreterApi instances.

Deprecated; please use the InterpreterApi.create method instead.

Summary

Public constructors

Public functions

InterpreterApi!
create(byteBuffer: ByteBuffer, options: InterpreterApi.Options!)

Constructs an InterpreterApi instance, using the specified model and options.

InterpreterApi!
create(modelFile: File, options: InterpreterApi.Options!)

Constructs an InterpreterApi instance, using the specified model and options.

Public constructors

InterpreterFactory

InterpreterFactory()

Public functions

create

fun create(byteBuffer: ByteBuffer, options: InterpreterApi.Options!): InterpreterApi!

Constructs an InterpreterApi instance, using the specified model and options. The model will be read from a ByteBuffer.

Parameters
byteBuffer: ByteBuffer

A pre-trained TF Lite model, in binary serialized form. The ByteBuffer should not be modified after the construction of an InterpreterApi instance. The ByteBuffer can be either a MappedByteBuffer that memory-maps a model file, or a direct ByteBuffer of nativeOrder() that contains the bytes content of a model.

options: InterpreterApi.Options!

A set of options for customizing interpreter behavior.

Throws
java.lang.IllegalArgumentException

if byteBuffer is not a MappedByteBuffer nor a direct ByteBuffer of nativeOrder.

create

fun create(modelFile: File, options: InterpreterApi.Options!): InterpreterApi!

Constructs an InterpreterApi instance, using the specified model and options. The model will be loaded from a file.

Parameters
modelFile: File

A file containing a pre-trained TF Lite model.

options: InterpreterApi.Options!

A set of options for customizing interpreter behavior.

Throws
java.lang.IllegalArgumentException

if modelFile does not encode a valid TensorFlow Lite model.