class TensorflowLite::Client

Overview

provides a simplified way to load and manipulate the tensorflow interpreter

the indexable module provides simplified access to the input tensors

Included Modules

Defined in:

tensorflow_lite/client.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(model : URI | Bytes | Path | Model | String, delegate : Delegate | Nil = nil, threads : Int | Nil = nil, labels : URI | Array(String) | Nil = nil) #

Configures the tensorflow interpreter with the options provided


[View source]
def self.new(model : URI | Bytes | Path | Model | String, delegate : Delegate | Nil = nil, threads : Int | Nil = nil, labels : URI | Array(String) | Nil = nil, &on_error : String -> Nil) #

Configures the tensorflow interpreter with the options provided


[View source]

Instance Method Detail

def input_tensor(*args, **options) #

input tensor details for manipulation and loading of input data


[View source]
def input_tensor(*args, **options, &) #

input tensor details for manipulation and loading of input data


[View source]
def input_tensor_count(*args, **options) #

input tensor details for manipulation and loading of input data


[View source]
def input_tensor_count(*args, **options, &) #

input tensor details for manipulation and loading of input data


[View source]
def interpreter : Interpreter #

[View source]
def invoke(*args, **options) #

run the model, processing the input tensors and updating the output tensors


[View source]
def invoke(*args, **options, &) #

run the model, processing the input tensors and updating the output tensors


[View source]
def invoke!(*args, **options) #

run the model, processing the input tensors and updating the output tensors


[View source]
def invoke!(*args, **options, &) #

run the model, processing the input tensors and updating the output tensors


[View source]
def labels #

attempt to extract any labels in the model


[View source]
def labels_fetched : Bool #

[View source]
def model : Model #

[View source]
def model_path : Path | Nil #

[View source]
def num_threads(*args, **options) #

This controls the number of CPU threads that the interpreter will use for its computations.


[View source]
def num_threads(*args, **options, &) #

This controls the number of CPU threads that the interpreter will use for its computations.


[View source]
def on_error(&callback : String -> Nil) #

provide a callback to receive any error messages


[View source]
def options : InterpreterOptions #

[View source]
def output(index : Int = 0) #

returns the output tensor at the provided index


[View source]
def output_tensor(*args, **options) #

output tensors details, used to obtain the results of an invokation


[View source]
def output_tensor(*args, **options, &) #

output tensors details, used to obtain the results of an invokation


[View source]
def output_tensor_count(*args, **options) #

output tensors details, used to obtain the results of an invokation


[View source]
def output_tensor_count(*args, **options, &) #

output tensors details, used to obtain the results of an invokation


[View source]
def outputs #

returns an array of output tensors


[View source]
def size #

the number of input tensors


[View source]