tflite_support.task.core.BaseOptions

Base options for TensorFlow Lite Task Library's Python APIs.

Represents external files used by the Task APIs (e.g. TF Lite FlatBuffer or plain-text labels file). The files can be specified by one of the following two ways:

(1) file contents loaded in file_content. (2) file path in file_name.

If more than one field of these fields is provided, they are used in this precedence order.

file_name Path to the index.
file_content The index file contents as bytes.
num_threads Number of thread, the default value is -1 which means Interpreter will decide what is the most appropriate num_threads.
use_coral If true, inference will be delegated to a connected Coral Edge TPU device.

Methods

create_from_pb2

View source

Creates a BaseOptions object from the given protobuf object.

to_pb2

View source

Generates a protobuf object to pass to the C++ layer.

__eq__

View source

Checks if this object is equal to the given object.

Args
other The object to be compared with.

Returns
True if the objects are equal.

file_content None
file_name None
num_threads -1
use_coral None