Skip to main content

PreprocessPlan.h File

Preprocess intent (what the user asked for) plus the resolved plan (what runs). More...

Included Headers

#include <array> #include <string> #include <utility> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat

Classes Index

structResizeSpec

Resize / letterbox / crop parameters. More...

structColorConvertSpec

Color-format conversion parameters. More...

structLayoutConvertSpec

Axis-permutation parameters for HWC↔CHW-style layout conversions. More...

structNormalizeSpec

Mean/stddev normalization parameters. More...

structQuantizeSpec

INT8 (or other low-precision) quantization parameters. More...

structTessellateSpec

MLA tessellation (tile-shuffle) parameters. More...

structPreprocessExplicitKnobs

Per-stage flags recording which preprocess fields the user set explicitly. More...

structTransform

Discriminated union of all per-stage transform specs. More...

structPreprocessOptions

User-facing preprocess intent — what the application asks for. More...

structPreprocessContract

Per-input contract describing what the preprocess stage expects to receive. More...

structPreprocessMetaContract

Metadata-side contract — names and fields the preprocess stage requires. More...

structResolvedPreprocessPlan

Final resolved plan — what the framework actually compiled and runs. More...

Description

Preprocess intent (what the user asked for) plus the resolved plan (what runs).

PreprocessOptions is the intent layer — what the application says it wants (resize to 640×640, normalize ImageNet-style, etc.). ResolvedPreprocessPlan is the plan layer — what the framework actually compiled, including which preprocess graph family was chosen (Preproc / Quant / Tess / QuantTess) and the negotiated MLA-side contract. The route planner produces the latter from the former plus the model's MPK manifest.

See Also

Model — the type that produces these

See Also

"Input planner" (§82 of the design deep dive)

File Listing

The file content with the documentation metadata removed is:

1
16#pragma once
17
18#include <array>
19#include <string>
20#include <utility>
21#include <vector>
22
23namespace simaai::neat {
24
32enum class AutoFlag {
33 Auto = 0,
34 On = 1,
35 Off = 2,
36};
37
40enum class InputKind {
41 Auto = 0,
42 Image = 1,
43 Tensor = 2,
44};
45
48enum class ResizeMode {
49 Stretch = 0,
50 Letterbox = 1,
51 Crop = 2,
52};
53
57 Auto = 0,
58 RGB = 1,
59 BGR = 2,
60 GRAY8 = 3,
61 NV12 = 4,
62 I420 = 5,
63};
64
67enum class NormalizePreset {
68 None = 0,
69 ImageNet = 1,
70 COCO_YOLO = 2,
71};
72
77 Disabled = 0,
78 Preproc = 1,
79 Quant = 2,
80 Tess = 3,
81 QuantTess = 4,
82};
83
86enum class TransformType {
87 Resize = 0,
88 ColorConvert = 1,
89 LayoutConvert = 2,
90 Normalize = 3,
91 Quantize = 4,
92 Tessellate = 5,
93};
94
97struct ResizeSpec {
99 int width = 0;
100 int height = 0;
102 int pad_value = 114;
103 std::string scaling_type = "BILINEAR";
104};
105
114};
115
120 std::vector<int>
122
124 bool has_perm() const {
125 return !perm.empty();
126 }
127};
128
133 std::array<float, 3> mean = {0.0f, 0.0f, 0.0f};
134 std::array<float, 3> stddev = {1.0f, 1.0f, 1.0f};
136 false;
137};
138
143 int zero_point = 0;
144 double scale = 0.0;
145 std::string output_dtype;
146};
147
152 std::vector<int> slice_shape;
154
156 void set_slice_shape(std::vector<int> shape) {
157 slice_shape = std::move(shape);
158 }
159
161 static int shape_dim(const std::vector<int>& shape, std::size_t index) {
162 return shape.size() > index ? shape[index] : 0;
163 }
164
166 int slice_height() const {
167 return shape_dim(slice_shape, 0);
168 }
169
171 int slice_width() const {
172 return shape_dim(slice_shape, 1);
173 }
174
176 int slice_channels() const {
177 return slice_shape.size() >= 3 ? slice_shape.back() : 0;
178 }
179
181 bool has_slice_shape() const {
182 return slice_height() > 0 && slice_width() > 0 && slice_channels() > 0;
183 }
184};
185
195 bool resize = false;
196 bool color_convert = false;
197 bool layout_convert = false;
198 bool normalize = false;
199 bool normalize_stats = false;
200 bool quantize_enable = false;
201 bool quantize_params = false;
202 bool tessellate_enable = false;
203 bool tessellate_geometry = false;
204};
205
214struct Transform {
222};
223
235
239
246
247 std::vector<Transform> transforms;
251};
252
261 std::string media_type;
262 std::string format;
263 int width = 0;
264 int height = 0;
265 int depth = 0;
266 int max_width = 0;
267 int max_height = 0;
268 int max_depth = 0;
269};
270
278 std::string meta_name = "GstSimaMeta";
279 std::vector<std::string> required_fields;
280};
281
297
299 bool transforms_override = false;
300 bool enabled = true;
303 std::string graph_kernel;
304 std::string graph_config_path;
306
307 std::vector<PreprocessContract>
311
312 std::vector<std::string>
314
316 std::string to_debug_string() const;
317};
318
319} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.