Skip to main content

PreprocOptions Struct

Construction options for a Preproc Node. More...

Declaration

struct simaai::neat::PreprocOptions { ... }

Included Headers

#include <Preproc.h>

Public Constructors Index

PreprocOptions ()=default

Default-construct with framework-default values; tune fields after construction. More...

PreprocOptions (const simaai::neat::Model &model)

Initialize options from a loaded Model (pulls input/output shapes, dtype, scale/zp). More...

Public Member Functions Index

voidset_input_shape (std::vector< int > shape)

Replace the input image shape (H, W, C). More...

voidset_output_shape (std::vector< int > shape)

Replace the output tensor shape. More...

voidset_slice_shape (std::vector< int > shape)

Replace the slice/tile shape used for batched processing. More...

intinput_height () const

Input image height (axis 0 of input_shape). More...

intinput_width () const

Input image width (axis 1 of input_shape). More...

intinput_channels () const

Input channel count. More...

intoutput_height () const

Output tensor height. More...

intoutput_width () const

Output tensor width. More...

intoutput_channels () const

Output channel count. More...

intslice_height () const

Slice height. More...

intslice_width () const

Slice width. More...

intslice_channels () const

Slice channel count. More...

boolhas_input_shape () const

True if input_shape is fully populated. More...

boolhas_output_shape () const

True if output_shape is fully populated. More...

boolhas_slice_shape () const

True if slice_shape is fully populated. More...

Public Member Attributes Index

std::vector< int >input_shape

Input image shape (H, W, C). More...

std::vector< int >output_shape

Output tensor shape after resize/normalize. More...

std::vector< int >slice_shape

Optional slice/tile shape used for batched processing. More...

intscaled_width = 0

Intermediate scaled width (before crop/pad), pixels. More...

intscaled_height = 0

Intermediate scaled height (before crop/pad), pixels. More...

intbatch_size = 1

Batch size processed per invocation. More...

boolnormalize = true

Apply mean/stddev normalization. More...

boolaspect_ratio = true

Preserve aspect ratio during resize (letterbox). More...

booltessellate = true

Tessellate output into MLA tile geometry. More...

booldynamic_input_dims = true

Allow dynamic input dimensions at runtime. More...

boolsingle_output_handoff = true

Hand off a single output buffer per cycle (vs. ping-pong). More...

intinput_offset = 0

Byte offset into the input buffer. More...

intinput_stride = 1

Element stride for input addressing. More...

intoutput_stride = 1

Element stride for output addressing. More...

std::optional< std::int64_t >q_zp

Output quantization zero-point (when emitting INT8/INT16). More...

std::optional< double >q_scale

Output quantization scale (when emitting INT8/INT16). More...

std::vector< float >channel_mean = {0.0f, 0.0f, 0.0f}

Per-channel mean used by normalize. More...

std::vector< float >channel_stddev = {1.0f, 1.0f, 1.0f}

Per-channel stddev used by normalize. More...

std::stringinput_img_type

Input pixel format (e.g. "NV12", "RGB"). More...

std::stringoutput_img_type = "RGB"

Output color space. More...

std::stringoutput_dtype = "INT16"

Output element dtype (e.g. "INT16", "BF16"). More...

std::stringscaling_type = "BILINEAR"

Resize interpolation ("BILINEAR", "NEAREST"). More...

std::stringpadding_type = "CENTER"

Letterbox padding mode ("CENTER", "TOPLEFT"). More...

std::stringgraph_name = "preproc"

CVU graph name in the kernel config. More...

std::stringnode_name = "preproc"

CVU node name in the kernel config. More...

std::stringelement_name

Optional GStreamer element name. More...

std::stringcpu = "CVU"

CPU/accelerator this stage runs on. More...

std::stringnext_cpu = "CVU"

CPU/accelerator the downstream stage runs on. More...

std::stringdebug = "EVXX_DBG_DISABLED"

Debug-output flag passed to the CVU kernel. More...

std::stringupstream_name = "decoder"

Name of the upstream element for tag wiring. More...

std::stringgraph_input_name = "input_image"

Input tensor name within the CVU graph. More...

intnum_buffers = 0

Override for the element's buffer pool size. More...

intnum_buffers_model = 0

Buffer count derived from the bound model. More...

boolnum_buffers_locked = false

If true, planner won't override num_buffers. More...

boolmodel_managed_contract = false

If true, the model owns the node contract resolution. More...

Public Static Functions Index

static intshape_dim (const std::vector< int > &shape, std::size_t index)

Safe accessor: return shape[index] or 0 if out of bounds. More...

static intshape_channels (const std::vector< int > &shape)

Last-axis channel count for an HWC-style shape, or 0 if rank < 3. More...

Description

Construction options for a Preproc Node.

Most fields are derived from the bound Model when the constructor that takes a Model is used; explicit setters are provided for graphs that don't have a model yet at Node-construction time.

Definition at line 44 of file Preproc.h.

Public Constructors

PreprocOptions()

simaai::neat::PreprocOptions::PreprocOptions ()
default

Default-construct with framework-default values; tune fields after construction.

Definition at line 46 of file Preproc.h.

PreprocOptions()

simaai::neat::PreprocOptions::PreprocOptions (const simaai::neat::Model & model)
explicit

Initialize options from a loaded Model (pulls input/output shapes, dtype, scale/zp).

Definition at line 48 of file Preproc.h.

Public Member Functions

has_input_shape()

bool simaai::neat::PreprocOptions::has_input_shape ()
inline

True if input_shape is fully populated.

Definition at line 170 of file Preproc.h.

170 bool has_input_shape() const {
171 return input_height() > 0 && input_width() > 0 && input_channels() > 0;
172 }

has_output_shape()

bool simaai::neat::PreprocOptions::has_output_shape ()
inline

True if output_shape is fully populated.

Definition at line 175 of file Preproc.h.

175 bool has_output_shape() const {
176 return output_height() > 0 && output_width() > 0 && output_channels() > 0;
177 }

has_slice_shape()

bool simaai::neat::PreprocOptions::has_slice_shape ()
inline

True if slice_shape is fully populated.

Definition at line 180 of file Preproc.h.

180 bool has_slice_shape() const {
181 return slice_height() > 0 && slice_width() > 0 && slice_channels() > 0;
182 }

input_channels()

int simaai::neat::PreprocOptions::input_channels ()
inline

Input channel count.

Definition at line 135 of file Preproc.h.

135 int input_channels() const {
137 }

input_height()

int simaai::neat::PreprocOptions::input_height ()
inline

Input image height (axis 0 of input_shape).

Definition at line 125 of file Preproc.h.

125 int input_height() const {
126 return shape_dim(input_shape, 0);
127 }

input_width()

int simaai::neat::PreprocOptions::input_width ()
inline

Input image width (axis 1 of input_shape).

Definition at line 130 of file Preproc.h.

130 int input_width() const {
131 return shape_dim(input_shape, 1);
132 }

output_channels()

int simaai::neat::PreprocOptions::output_channels ()
inline

Output channel count.

Definition at line 150 of file Preproc.h.

150 int output_channels() const {
152 }

output_height()

int simaai::neat::PreprocOptions::output_height ()
inline

Output tensor height.

Definition at line 140 of file Preproc.h.

140 int output_height() const {
141 return shape_dim(output_shape, 0);
142 }

output_width()

int simaai::neat::PreprocOptions::output_width ()
inline

Output tensor width.

Definition at line 145 of file Preproc.h.

145 int output_width() const {
146 return shape_dim(output_shape, 1);
147 }

set_input_shape()

void simaai::neat::PreprocOptions::set_input_shape (std::vector< int > shape)
inline

Replace the input image shape (H, W, C).

Definition at line 100 of file Preproc.h.

100 void set_input_shape(std::vector<int> shape) {
101 input_shape = std::move(shape);
102 }

set_output_shape()

void simaai::neat::PreprocOptions::set_output_shape (std::vector< int > shape)
inline

Replace the output tensor shape.

Definition at line 105 of file Preproc.h.

105 void set_output_shape(std::vector<int> shape) {
106 output_shape = std::move(shape);
107 }

set_slice_shape()

void simaai::neat::PreprocOptions::set_slice_shape (std::vector< int > shape)
inline

Replace the slice/tile shape used for batched processing.

Definition at line 110 of file Preproc.h.

110 void set_slice_shape(std::vector<int> shape) {
111 slice_shape = std::move(shape);
112 }

slice_channels()

int simaai::neat::PreprocOptions::slice_channels ()
inline

Slice channel count.

Definition at line 165 of file Preproc.h.

165 int slice_channels() const {
167 }

slice_height()

int simaai::neat::PreprocOptions::slice_height ()
inline

Slice height.

Definition at line 155 of file Preproc.h.

155 int slice_height() const {
156 return shape_dim(slice_shape, 0);
157 }

slice_width()

int simaai::neat::PreprocOptions::slice_width ()
inline

Slice width.

Definition at line 160 of file Preproc.h.

160 int slice_width() const {
161 return shape_dim(slice_shape, 1);
162 }

Public Member Attributes

aspect_ratio

bool simaai::neat::PreprocOptions::aspect_ratio = true

Preserve aspect ratio during resize (letterbox).

Definition at line 60 of file Preproc.h.

60 bool aspect_ratio = true;

batch_size

int simaai::neat::PreprocOptions::batch_size = 1

Batch size processed per invocation.

Definition at line 57 of file Preproc.h.

57 int batch_size = 1;

channel_mean

std::vector<float> simaai::neat::PreprocOptions::channel_mean = {0.0f, 0.0f, 0.0f}

Per-channel mean used by normalize.

Definition at line 72 of file Preproc.h.

72 std::vector<float> channel_mean = {0.0f, 0.0f, 0.0f};

channel_stddev

std::vector<float> simaai::neat::PreprocOptions::channel_stddev = {1.0f, 1.0f, 1.0f}

Per-channel stddev used by normalize.

Definition at line 73 of file Preproc.h.

73 std::vector<float> channel_stddev = {1.0f, 1.0f, 1.0f};

cpu

std::string simaai::neat::PreprocOptions::cpu = "CVU"

CPU/accelerator this stage runs on.

Definition at line 84 of file Preproc.h.

84 std::string cpu = "CVU";

debug

std::string simaai::neat::PreprocOptions::debug = "EVXX_DBG_DISABLED"

Debug-output flag passed to the CVU kernel.

Definition at line 86 of file Preproc.h.

86 std::string debug = "EVXX_DBG_DISABLED";

dynamic_input_dims

bool simaai::neat::PreprocOptions::dynamic_input_dims = true

Allow dynamic input dimensions at runtime.

Definition at line 62 of file Preproc.h.

62 bool dynamic_input_dims = true;

element_name

std::string simaai::neat::PreprocOptions::element_name

Optional GStreamer element name.

Definition at line 83 of file Preproc.h.

83 std::string element_name;

graph_input_name

std::string simaai::neat::PreprocOptions::graph_input_name = "input_image"

Input tensor name within the CVU graph.

Definition at line 89 of file Preproc.h.

89 std::string graph_input_name = "input_image";

graph_name

std::string simaai::neat::PreprocOptions::graph_name = "preproc"

CVU graph name in the kernel config.

Definition at line 81 of file Preproc.h.

81 std::string graph_name = "preproc";

input_img_type

std::string simaai::neat::PreprocOptions::input_img_type

Input pixel format (e.g. "NV12", "RGB").

Definition at line 75 of file Preproc.h.

75 std::string input_img_type;

input_offset

int simaai::neat::PreprocOptions::input_offset = 0

Byte offset into the input buffer.

Definition at line 65 of file Preproc.h.

65 int input_offset = 0;

input_shape

std::vector<int> simaai::neat::PreprocOptions::input_shape

Input image shape (H, W, C).

Definition at line 50 of file Preproc.h.

50 std::vector<int> input_shape;

input_stride

int simaai::neat::PreprocOptions::input_stride = 1

Element stride for input addressing.

Definition at line 66 of file Preproc.h.

66 int input_stride = 1;

model_managed_contract

bool simaai::neat::PreprocOptions::model_managed_contract = false

If true, the model owns the node contract resolution.

Definition at line 94 of file Preproc.h.

94 bool model_managed_contract = false;

next_cpu

std::string simaai::neat::PreprocOptions::next_cpu = "CVU"

CPU/accelerator the downstream stage runs on.

Definition at line 85 of file Preproc.h.

85 std::string next_cpu = "CVU";

node_name

std::string simaai::neat::PreprocOptions::node_name = "preproc"

CVU node name in the kernel config.

Definition at line 82 of file Preproc.h.

82 std::string node_name = "preproc";

normalize

bool simaai::neat::PreprocOptions::normalize = true

Apply mean/stddev normalization.

Definition at line 59 of file Preproc.h.

59 bool normalize = true;

num_buffers

int simaai::neat::PreprocOptions::num_buffers = 0

Override for the element's buffer pool size.

Definition at line 91 of file Preproc.h.

91 int num_buffers = 0;

num_buffers_locked

bool simaai::neat::PreprocOptions::num_buffers_locked = false

If true, planner won't override num_buffers.

Definition at line 93 of file Preproc.h.

93 bool num_buffers_locked = false;

num_buffers_model

int simaai::neat::PreprocOptions::num_buffers_model = 0

Buffer count derived from the bound model.

Definition at line 92 of file Preproc.h.

output_dtype

std::string simaai::neat::PreprocOptions::output_dtype = "INT16"

Output element dtype (e.g. "INT16", "BF16").

Definition at line 77 of file Preproc.h.

77 std::string output_dtype = "INT16";

output_img_type

std::string simaai::neat::PreprocOptions::output_img_type = "RGB"

Output color space.

Definition at line 76 of file Preproc.h.

76 std::string output_img_type = "RGB";

output_shape

std::vector<int> simaai::neat::PreprocOptions::output_shape

Output tensor shape after resize/normalize.

Definition at line 51 of file Preproc.h.

51 std::vector<int> output_shape;

output_stride

int simaai::neat::PreprocOptions::output_stride = 1

Element stride for output addressing.

Definition at line 67 of file Preproc.h.

67 int output_stride = 1;

padding_type

std::string simaai::neat::PreprocOptions::padding_type = "CENTER"

Letterbox padding mode ("CENTER", "TOPLEFT").

Definition at line 79 of file Preproc.h.

79 std::string padding_type = "CENTER";

q_scale

std::optional<double> simaai::neat::PreprocOptions::q_scale

Output quantization scale (when emitting INT8/INT16).

Definition at line 70 of file Preproc.h.

70 std::optional<double> q_scale;

q_zp

std::optional<std::int64_t> simaai::neat::PreprocOptions::q_zp

Output quantization zero-point (when emitting INT8/INT16).

Definition at line 69 of file Preproc.h.

69 std::optional<std::int64_t> q_zp;

scaled_height

int simaai::neat::PreprocOptions::scaled_height = 0

Intermediate scaled height (before crop/pad), pixels.

Definition at line 55 of file Preproc.h.

55 int scaled_height = 0;

scaled_width

int simaai::neat::PreprocOptions::scaled_width = 0

Intermediate scaled width (before crop/pad), pixels.

Definition at line 54 of file Preproc.h.

54 int scaled_width = 0;

scaling_type

std::string simaai::neat::PreprocOptions::scaling_type = "BILINEAR"

Resize interpolation ("BILINEAR", "NEAREST").

Definition at line 78 of file Preproc.h.

78 std::string scaling_type = "BILINEAR";

single_output_handoff

bool simaai::neat::PreprocOptions::single_output_handoff = true

Hand off a single output buffer per cycle (vs. ping-pong).

Definition at line 63 of file Preproc.h.

slice_shape

std::vector<int> simaai::neat::PreprocOptions::slice_shape

Optional slice/tile shape used for batched processing.

Definition at line 52 of file Preproc.h.

52 std::vector<int> slice_shape;

tessellate

bool simaai::neat::PreprocOptions::tessellate = true

Tessellate output into MLA tile geometry.

Definition at line 61 of file Preproc.h.

61 bool tessellate = true;

upstream_name

std::string simaai::neat::PreprocOptions::upstream_name = "decoder"

Name of the upstream element for tag wiring.

Definition at line 88 of file Preproc.h.

88 std::string upstream_name = "decoder";

Public Static Functions

shape_channels()

int simaai::neat::PreprocOptions::shape_channels (const std::vector< int > & shape)
inline static

Last-axis channel count for an HWC-style shape, or 0 if rank < 3.

Definition at line 120 of file Preproc.h.

120 static int shape_channels(const std::vector<int>& shape) {
121 return shape.size() >= 3 ? shape.back() : 0;
122 }

shape_dim()

int simaai::neat::PreprocOptions::shape_dim (const std::vector< int > & shape, std::size_t index)
inline static

Safe accessor: return shape[index] or 0 if out of bounds.

Definition at line 115 of file Preproc.h.

115 static int shape_dim(const std::vector<int>& shape, std::size_t index) {
116 return shape.size() > index ? shape[index] : 0;
117 }

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.