Перейти до основного вмісту

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...

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

Submit without waiting for input-queue space; full queues follow RunOptions::overflow_policy. More...

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

Sample-preserving nonblocking submission; returns false when input admission rejects it. 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...

simaai::neat::MeasureScopestart_measurement (bool include_plugin_latency)

Deprecated: use start_measurement(). True also collects plugin latency. 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 613 of file Model.h.

Friends​

internal::ModelAccess​

friend struct internal::ModelAccess

Definition at line 673 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 616 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 618 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 620 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 623 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 626 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 629 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 668 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 670 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 652 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 638 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 640 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 658 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 660 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 663 of file Model.h.

start_measurement()​

simaai::neat::MeasureScope simaai::neat::Model::Runner::start_measurement (bool include_plugin_latency)

Deprecated: use start_measurement(). True also collects plugin latency.

Definition at line 666 of file Model.h.

try_push()​

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

Submit without waiting for input-queue space; full queues follow RunOptions::overflow_policy.

Definition at line 643 of file Model.h.

try_push()​

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

Sample-preserving nonblocking submission; returns false when input admission rejects it.

Definition at line 645 of file Model.h.

Private Member Attributes​

ingress_names_​

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

Definition at line 676 of file Model.h.

run_​

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

Definition at line 674 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 675 of file Model.h.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.