Class Pipeline#

The inference stage over model configs, a JavaScript processor and JavaScript engines, which the scopes that run them define under the same names (defineProcessor(), defineEngine()).

class Pipeline(abi, pipeline)#

A pipeline (anira_pipeline), the web twin of anira::Pipeline, one member per C entry: addInference (the inference stage over model configs), addProcessor (the custom stage, a JavaScript processor) and addEngine (a JavaScript engine the model entries name by id), which the scopes that run them define under the same name (defineProcessor, defineEngine). Where the web differs: a processor and an engine are named, their code living in each realm that runs them (add_processor and add_engine take the objects in C++), and the pipeline is destroyed with destroy() once the handlers exist (a handler copies it).

Arguments:
  • abi (AniraBindings)

  • pipeline (number)

static create(anira)#
Arguments:
  • anira (WithAbi)

Returns:

Pipeline

addInference(models)#

The inference stage over models, the variants (one in this pre-release), on the default candidates: every engine of the build and every registered engine, on the CPU.

Arguments:
  • models (ModelConfig | ModelConfig[])

Returns:

this

addEngine(id, options={})#

A JavaScript engine under its reverse-URI id, which the model entries name.

Arguments:
  • id (string)

  • options (EngineOptions)

Returns:

this

addProcessor(name, options)#

The pipeline’s one JavaScript processor, under name.

Arguments:
  • name (string)

  • options (ProcessorOptions)

Returns:

this

native()#

The anira_pipeline* the raw entries take.

Returns:

number

destroy()#