View Source ExVision.Model protocol (Ex Vision v0.4.0)

A protocol describing a generic ExVision model.

Summary

Types

A typespec definiting ExVision's model input, either as single model_input_t/0 or a list.

A type describing a single element that can be processed by ExVision's models

A generic type indicating a model output. For details on each model, refer to it's own output_t() definition.

t()

All the types that implement this protocol.

Functions

Function used to submit the input for inference in a process setting when the model is served as a process.

A function used to submit input for inference (inline variant).

Starts and links the module in process workflow

Types

@type input_t() :: model_input_t() | [model_input_t()]

A typespec definiting ExVision's model input, either as single model_input_t/0 or a list.

@type model_input_t() :: Path.t() | Nx.Tensor.t() | Vix.Vips.Image.t()

A type describing a single element that can be processed by ExVision's models

@type output_t() :: any()

A generic type indicating a model output. For details on each model, refer to it's own output_t() definition.

@type t() :: term()

All the types that implement this protocol.

Functions

@spec as_serving(t()) :: Nx.Serving.t()
Link to this function

batched_run(model, input)

View Source
@spec batched_run(t(), input_t()) :: output_t()

Function used to submit the input for inference in a process setting when the model is served as a process.

@spec run(t(), input_t()) :: output_t() | [output_t()]

A function used to submit input for inference (inline variant).

Link to this function

start_link(model, options \\ [])

View Source
@spec start_link(
  t(),
  keyword()
) :: GenServer.on_start()

Starts and links the module in process workflow