Skip to main content

SimaBoxDecode Class

EV74 postprocess Node that decodes detection-head tensors into object boxes (with NMS). More...

Declaration

class simaai::neat::SimaBoxDecode { ... }

Included Headers

#include <SimaBoxDecode.h>

Base classes

classNode
classInputContractConfigurable
classOutputSpecProvider
classPreprocessMetaRequirementProvider
classNodeContractProvider
classNodeContractConfigurable

Public Constructors Index

SimaBoxDecode (BoxDecodeType decode_type, double detection_threshold=0.0, double nms_iou_threshold=0.0, int top_k=0, const std::string &element_name="", int original_width=0, int original_height=0, int model_width=0, int model_height=0, BoxDecodeTypeOption decode_type_option=BoxDecodeTypeOption::Auto)

Construct from raw geometry — for graphs without a bound Model. More...

SimaBoxDecode (const simaai::neat::Model &model, BoxDecodeType decode_type, double detection_threshold=0.0, double nms_iou_threshold=0.0, int top_k=0, const std::string &element_name="", std::optional< bool > route_tess_needed=std::nullopt, std::optional< bool > route_quant_needed=std::nullopt, int original_width=0, int original_height=0, int model_width=0, int model_height=0, std::optional< ResizeMode > resize_mode_override=std::nullopt, BoxDecodeTypeOption decode_type_option=BoxDecodeTypeOption::Auto)

Construct from a bound Model — pulls geometry and routing flags from the model. More...

Public Member Functions Index

std::stringkind () const override

Type label for this Node kind. More...

NodeCapsBehaviorcaps_behavior () const override

Whether the Node negotiates static or dynamic caps. More...

std::stringbackend_fragment (int node_index) const override

GStreamer fragment this Node emits. More...

std::vector< std::string >element_names (int node_index) const override

Deterministic element names this Node will create. More...

OutputSpecoutput_spec (const OutputSpec &input) const override

Negotiated downstream caps produced by this Node. More...

std::optional< PreprocessMetaRequirement >preprocess_meta_requirement () const override

Preprocess metadata fields this Node requires upstream. More...

NodeContractDefinitioncontract_definition () const override

Structural contract definition for this Node. More...

boolcompile_node_contract (const ContractCompileInput &input, CompiledNodeContract *out, std::string *err) const override

Compile this Node's contract from the given input. More...

voidapply_compiled_contract (const CompiledNodeContract &contract, std::string *err) override

Apply a compiled contract back into this Node. More...

voidapply_input_contract (const InputContract &contract, std::string *err) override

Apply an input contract from upstream. More...

Private Member Attributes Index

std::unique_ptr< BoxDecodeOptionsInternal >opt_
std::optional< InputContract >input_contract_

Description

EV74 postprocess Node that decodes detection-head tensors into object boxes (with NMS).

Pick the constructor that matches what your application has on hand: the bare-parameter form for raw inputs, or the Model-aware form when the model carries the geometry and route flags. Decoder variants live in BoxDecodeType — pick the one matching your model family (YOLOv5, SSD, RetinaNet, etc.).

See Also

pipeline/BoxDecodeType.h

Definition at line 53 of file SimaBoxDecode.h.

Public Constructors

SimaBoxDecode()

simaai::neat::SimaBoxDecode::SimaBoxDecode (BoxDecodeType decode_type, double detection_threshold=0, double nms_iou_threshold=0, int top_k=0, const std::string & element_name="", int original_width=0, int original_height=0, int model_width=0, int model_height=0, BoxDecodeTypeOption decode_type_option=BoxDecodeTypeOption::Auto)
explicit

Construct from raw geometry — for graphs without a bound Model.

Parameters
decode_type

Decoder variant (see BoxDecodeType).

detection_threshold

Score threshold; boxes below are dropped (0 = use default).

nms_iou_threshold

NMS IoU threshold (0 = use default).

top_k

Max boxes to keep after NMS (0 = unlimited / variant default).

element_name

Optional GStreamer element name.

original_width

Width of the unscaled source frame (used for box rescaling).

original_height

Height of the unscaled source frame.

model_width

Input width the model was trained for.

model_height

Input height the model was trained for.

decode_type_option

Decoder sub-variant selector (Auto to defer to the model).

Definition at line 74 of file SimaBoxDecode.h.

SimaBoxDecode()

simaai::neat::SimaBoxDecode::SimaBoxDecode (const simaai::neat::Model & model, BoxDecodeType decode_type, double detection_threshold=0, double nms_iou_threshold=0, int top_k=0, const std::string & element_name="", std::optional< bool > route_tess_needed=std::nullopt, std::optional< bool > route_quant_needed=std::nullopt, int original_width=0, int original_height=0, int model_width=0, int model_height=0, std::optional< ResizeMode > resize_mode_override=std::nullopt, BoxDecodeTypeOption decode_type_option=BoxDecodeTypeOption::Auto)
explicit

Construct from a bound Model — pulls geometry and routing flags from the model.

Parameters
model

Source model (provides input shape, routing hints, etc.).

decode_type

Decoder variant (see BoxDecodeType).

detection_threshold

Score threshold (0 = use default).

nms_iou_threshold

NMS IoU threshold (0 = use default).

top_k

Max boxes to keep after NMS.

element_name

Optional GStreamer element name.

route_tess_needed

Override: does the route need a tess stage upstream?

route_quant_needed

Override: does the route need a quant stage upstream?

original_width

Width of the unscaled source frame.

original_height

Height of the unscaled source frame.

model_width

Optional override: model-input width. 0 = derive from the model pack (default). When set, the value flows through to the decoder kernel's spatial knobs; the model-managed compiled_contract still drives quant / decode-family / tensor layout, so callers can override geometry without falling off the model-managed contract path.

model_height

Optional override: model-input height. Same semantics as model_width. Both must be set together (or both zero).

resize_mode_override

Optional override: explicit preprocess resize mode (Stretch/Letterbox/Crop). Use when running the model without an upstream Preproc stage and the per-buffer preproc_resize_mode meta isn't being written by an upstream element. When set, the contract drops preproc_resize_mode from the required-meta list so buffers flow through cleanly; otherwise the value is sourced from per-buffer GstSimaaiPreprocessMeta as before.

decode_type_option

Decoder sub-variant selector.

Definition at line 110 of file SimaBoxDecode.h.

Public Member Functions

apply_compiled_contract()

void simaai::neat::SimaBoxDecode::apply_compiled_contract (const CompiledNodeContract & contract, std::string * err)

Apply a compiled contract back into this Node.

Definition at line 159 of file SimaBoxDecode.h.

apply_input_contract()

void simaai::neat::SimaBoxDecode::apply_input_contract (const InputContract & contract, std::string * err)

Apply an input contract from upstream.

Definition at line 161 of file SimaBoxDecode.h.

backend_fragment()

std::string simaai::neat::SimaBoxDecode::backend_fragment (int node_index)

GStreamer fragment this Node emits.

Definition at line 146 of file SimaBoxDecode.h.

caps_behavior()

NodeCapsBehavior simaai::neat::SimaBoxDecode::caps_behavior ()
inline

Whether the Node negotiates static or dynamic caps.

Definition at line 142 of file SimaBoxDecode.h.

142 NodeCapsBehavior caps_behavior() const override {
143 return NodeCapsBehavior::Static;
144 }

compile_node_contract()

bool simaai::neat::SimaBoxDecode::compile_node_contract (const ContractCompileInput & input, CompiledNodeContract * out, std::string * err)

Compile this Node's contract from the given input.

Definition at line 156 of file SimaBoxDecode.h.

contract_definition()

NodeContractDefinition simaai::neat::SimaBoxDecode::contract_definition ()

Structural contract definition for this Node.

Definition at line 154 of file SimaBoxDecode.h.

element_names()

std::vector< std::string > simaai::neat::SimaBoxDecode::element_names (int node_index)

Deterministic element names this Node will create.

Definition at line 148 of file SimaBoxDecode.h.

kind()

std::string simaai::neat::SimaBoxDecode::kind ()
inline

Type label for this Node kind.

Definition at line 138 of file SimaBoxDecode.h.

138 std::string kind() const override {
139 return "SimaBoxDecode";
140 }

output_spec()

OutputSpec simaai::neat::SimaBoxDecode::output_spec (const OutputSpec & input)

Negotiated downstream caps produced by this Node.

Definition at line 150 of file SimaBoxDecode.h.

preprocess_meta_requirement()

std::optional< PreprocessMetaRequirement > simaai::neat::SimaBoxDecode::preprocess_meta_requirement ()

Preprocess metadata fields this Node requires upstream.

Definition at line 152 of file SimaBoxDecode.h.

Private Member Attributes

input_contract_

std::optional<InputContract> simaai::neat::SimaBoxDecode::input_contract_

Definition at line 186 of file SimaBoxDecode.h.

186 std::optional<InputContract> input_contract_;

opt_

std::unique_ptr<BoxDecodeOptionsInternal> simaai::neat::SimaBoxDecode::opt_

Definition at line 185 of file SimaBoxDecode.h.

185 std::unique_ptr<BoxDecodeOptionsInternal> opt_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.