Skip to main content

Runner Class

Long-lived execution handle returned by Model::build(...). More...

Declaration

class simaai::neat::Model::Runner { ... }

Included Headers

#include <Model.h>

Friends Index

structinternal::ModelAccess

Public Constructors Index

Runner ()=default

Construct an empty Runner; assign from a built Runner before use. More...

Runner (simaai::neat::Run run)

Wrap a Run handle with no special tensor/ingress configuration. More...

Runner (simaai::neat::Run run, const simaai::neat::InputOptions &tensor_input_opt)

Wrap a Run handle that was built for tensor-mode input with the given InputOptions. More...

Runner (simaai::neat::Run run, const simaai::neat::InputOptions &tensor_input_opt, std::vector< std::string > ingress_names)

Wrap a Run handle with tensor input options and explicit ingress port names (multi-input models). More...

Runner (simaai::neat::Run run, std::vector< std::string > ingress_names)

Wrap a Run handle with explicit ingress port names (multi-input, non-tensor mode). More...

Public Operators Index

operator bool () const noexcept

Returns true if the underlying Run is alive and ready to push/pull. More...

Public Member Functions Index

boolpush (const simaai::neat::TensorList &inputs)

Push a list of Tensor inputs (one per ingress port). More...

boolpush (const simaai::neat::Sample &inputs)

Push a list of Sample inputs (full Samples carry per-buffer metadata). More...

simaai::neat::Samplepull (int timeout_ms=-1)

Pull the next produced output Sample list. More...

simaai::neat::TensorListrun (const simaai::neat::TensorList &inputs, int timeout_ms=-1)

One-shot synchronous push+pull from Tensor inputs. More...

simaai::neat::Samplerun (const simaai::neat::Sample &inputs, int timeout_ms=-1)

One-shot synchronous push+pull from Sample inputs. More...

simaai::neat::MeasureScopestart_measurement (const simaai::neat::MeasureOptions &opt={})

Start observing caller-owned push/pull code without consuming outputs. More...

voidclose ()

Close input (sends EOS) and release the underlying Run. More...

voidclose_input ()

Send EOS into the input queue without releasing the Run (lets pull drain in flight). More...

Private Member Attributes Index

simaai::neat::Runrun_ {}
std::optional< simaai::neat::InputOptions >tensor_input_opt_for_cv_ {}
std::vector< std::string >ingress_names_

Description

Long-lived execution handle returned by Model::build(...).

Wraps an underlying Run plus the bookkeeping needed to convert user-friendly input types (cv::Mat, TensorList, Sample) into the right Sample shape for the model's appsrc. Use the Runner for streaming workloads; use the convenience Model::run() overloads for one-shot inference.

 namespace neat = simaai::neat;
 neat::Model model("yolo.tar.gz");
 auto runner = model.build();
 while (have_input) {
  runner.push(next_frame);
  auto sample = runner.pull(/ * timeout_ms = * / 100);
  if (!sample.empty()) handle(sample);
 }
 runner.close();

Definition at line 477 of file Model.h.

Friends

internal::ModelAccess

friend struct internal::ModelAccess

Definition at line 529 of file Model.h.

Public Constructors

Runner()

simaai::neat::Model::Runner::Runner ()
default

Construct an empty Runner; assign from a built Runner before use.

Definition at line 480 of file Model.h.

Runner()

simaai::neat::Model::Runner::Runner (simaai::neat::Run run)
explicit

Wrap a Run handle with no special tensor/ingress configuration.

Definition at line 482 of file Model.h.

Runner()

simaai::neat::Model::Runner::Runner (simaai::neat::Run run, const simaai::neat::InputOptions & tensor_input_opt)

Wrap a Run handle that was built for tensor-mode input with the given InputOptions.

Definition at line 484 of file Model.h.

Runner()

simaai::neat::Model::Runner::Runner (simaai::neat::Run run, const simaai::neat::InputOptions & tensor_input_opt, std::vector< std::string > ingress_names)

Wrap a Run handle with tensor input options and explicit ingress port names (multi-input models).

Definition at line 487 of file Model.h.

Runner()

simaai::neat::Model::Runner::Runner (simaai::neat::Run run, std::vector< std::string > ingress_names)

Wrap a Run handle with explicit ingress port names (multi-input, non-tensor mode).

Definition at line 490 of file Model.h.

Public Operators

operator bool()

simaai::neat::Model::Runner::operator bool ()
explicit noexcept

Returns true if the underlying Run is alive and ready to push/pull.

Definition at line 493 of file Model.h.

Public Member Functions

close()

void simaai::neat::Model::Runner::close ()

Close input (sends EOS) and release the underlying Run.

Definition at line 524 of file Model.h.

close_input()

void simaai::neat::Model::Runner::close_input ()

Send EOS into the input queue without releasing the Run (lets pull drain in flight).

Definition at line 526 of file Model.h.

pull()

simaai::neat::Sample simaai::neat::Model::Runner::pull (int timeout_ms=-1)

Pull the next produced output Sample list.

Parameters
timeout_ms

Maximum time to wait, in milliseconds; -1 means wait forever; 0 is non-blocking.

Returns

The next Sample. Empty if the timeout elapsed or the pipeline closed.

Definition at line 511 of file Model.h.

push()

bool simaai::neat::Model::Runner::push (const simaai::neat::TensorList & inputs)

Push a list of Tensor inputs (one per ingress port).

Definition at line 502 of file Model.h.

push()

bool simaai::neat::Model::Runner::push (const simaai::neat::Sample & inputs)

Push a list of Sample inputs (full Samples carry per-buffer metadata).

Definition at line 504 of file Model.h.

run()

simaai::neat::TensorList simaai::neat::Model::Runner::run (const simaai::neat::TensorList & inputs, int timeout_ms=-1)

One-shot synchronous push+pull from Tensor inputs.

Definition at line 517 of file Model.h.

run()

simaai::neat::Sample simaai::neat::Model::Runner::run (const simaai::neat::Sample & inputs, int timeout_ms=-1)

One-shot synchronous push+pull from Sample inputs.

Definition at line 519 of file Model.h.

start_measurement()

simaai::neat::MeasureScope simaai::neat::Model::Runner::start_measurement (const simaai::neat::MeasureOptions & opt={})

Start observing caller-owned push/pull code without consuming outputs.

Definition at line 522 of file Model.h.

Private Member Attributes

ingress_names_

std::vector<std::string> simaai::neat::Model::Runner::ingress_names_

Definition at line 532 of file Model.h.

run_

simaai::neat::Run simaai::neat::Model::Runner::run_ {}

Definition at line 530 of file Model.h.

tensor_input_opt_for_cv_

std::optional<simaai::neat::InputOptions> simaai::neat::Model::Runner::tensor_input_opt_for_cv_ {}

Definition at line 531 of file Model.h.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.