The following classes are available globally.
Encapsulates information about the input and output layers of a model, fully described by a
TIOLayerDescription. Used internally by a model when parsing its description. Also used to match inputs and outputs to their corresponding layers.
This is an algebraic data type inspired by Remodel: https://github.com/facebook/remodel. In Swift it would be an Enumeration with Associated Values. The intent is to capture the variety of inputs and outputs a model can accept and produce in a unified interface.
Normally you will not need to interact with this class, although you may request aSee more
TIOLayerDescriptionfrom a conforming
TIOModelfor inputs or outputs that you are specifically interested in, for example, a pixel buffer input when you want greater control over scaling and clipping an image before passing it to the model.
@interface TIOLayerInterface : NSObject
class TIOLayerInterface : NSObject
The description of a vector (array) input or output later.
Vector inputs and outputs are always unrolled vectors, and from the tensor’s perspective they are just an array of bytes. The total length of a vector will be the total volume of the layer. For example, if an input layer is a tensor of shape
(24,24,2), the length of the vector will be
24x24x2 = 1152.
TensorFlow Lite models expect row major ordering of bytes, such that higher order dimensions are traversed first. For example, a 2x4 matrix with the following values:
@code [[1 2 3 4] [5 6 7 8]] @endcode
should be unrolled and provided to the model as:
@code [1 2 3 4 5 6 7 8] @endcode
i.e, start with the row and traverse the columns before moving to the next row.
Because output layers are also exposed as an array of bytes, a
TIOTFLiteModelwill always return a vector in one dimension. If is up to you to reshape it if required.
@warning ASee more
TIOVectorLayerDescription‘s length is different than the byte length of a
TIODataobject. For example a quantized
TIOVector(uint8_t) of length 4 will occupy 4 bytes of memory but an unquantized
TIOVector(float_t) of length 4 will occupy 16 bytes of memory.
Encapsulates information about a
TIOModelwithout actually loading the model.
TIOModelBundleis used by the UI to show model details and is used to instantiate model instances as a model factory. There is currently a one-to-one correspondence between a
TIOModelBundleand a .tfbundle folder in the models directory.
A model bundle folder must contain at least a model.json file, which contains information about the model. Some information is required, such as the identifier and name field, while other information may be added as needed by your use case.
See TIOModelBundleJSONSchema.h for a list of required fields and their types.See more
@interface TIOModelBundle : NSObject
class TIOModelBundle : NSObject
Usage: @code [TIOModelBundleManager.sharedManager loadModelBundlesAtPath:modelsPath error:&error]; TIOModelBundle *bundle = [TIOModelBundleManager.sharedManager bundleWithId:@See more
model = [bundle newModel]; @endcode
@interface TIOModelBundleManager : NSObject
class TIOModelBundleManager : NSObject
TIOModelBundleValidatoris responsible for ensuring that the contents of a TensorIO bundle are valid.
The bundle validator will commonly be used to validate bundles that are deployed after release of an app rather than those that are packaged with it. It validates each part of the TensorIO model spec, and also allows the client to provide a custom validation block.See more
@interface TIOModelBundleValidator : NSObject
class TIOModelBundleValidator : NSObject
Encapsulates additional options that a model would like to communicate to it consumers.See more
@interface TIOModelOptions : NSObject
class TIOModelOptions : NSObject
A placeholder model declares an interface but does not contain any underlying model implementation. It is used to gather labeled data for a model that has not been trained yet. Performing inference with a placeholder model will return an empty result.See more
TIOVisionPipelineis responsible for scaling and croping, rotating, and converting the provided pixel buffer to an ARGB or BGRA pixel format, using properties specified by the model.
@interface TIOVisionPipeline : NSObject
class TIOVisionPipeline : NSObject