Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
inference_model.c
Go to the documentation of this file.
1/*
2 * Copyright 2026 OpenUAS
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/** @file inference_model.c
19 * @brief Verified model descriptors and bounded per-context tensor storage.
20 * @details Descriptors bind preprocessing to graph bytes; application adapters still qualify semantic outputs. */
21#include "inference_model.h"
22#include "sha256fst.h"
23
24#include <errno.h>
25#include <fcntl.h>
26#include <math.h>
27#include <stdio.h>
28#include <stdlib.h>
29#include <string.h>
30#include <sys/stat.h>
31#include <sys/mman.h>
32#include <unistd.h>
33
34/** @brief Independent duplicate masks for descriptor-wide and indexed tensor fields. */
40
41bool inference_file_sha256(const char *filename, char digest[65])
42{
43 return sha256_file(filename, digest);
44}
45
46/** @brief Store an owned bounded name so parser-buffer destruction cannot invalidate tensor views. */
47static bool copy_name(char *destination, size_t capacity, const char *value)
48{
49 const size_t length = strlen(value);
50 if (!length || length >= capacity) return false;
51 for (size_t index = 0; index <= length; ++index) {
52 if ((unsigned char)value[index] < 32 && value[index]) return false;
53 destination[index] = value[index];
54 }
55 return true;
56}
57
58/** @brief Accept concrete positive extents only; export-time dynamic axes need an explicit execution shape. */
59static bool parse_dimensions(struct onnx_tensor *tensor, const char *text)
60{
61 tensor->rank = 0;
62 while (*text) {
63 if (tensor->rank == ONNX_RANK_LIMIT || *text < '1' || *text > '9') return false;
64 errno = 0;
65 char *end = NULL;
66 const unsigned long long number = strtoull(text, &end, 10);
67 if (errno || end == text || number > INT64_MAX || (*end && *end != ',')) return false;
68 tensor->dimensions[tensor->rank++] = (int64_t)number;
69 text = *end ? end + 1 : end;
70 if (*end && !*text) return false;
71 }
72 return tensor->rank != 0;
73}
74
75/** @brief Accept one shared channel value or exactly three, without silently broadcasting an incomplete pair. */
76static bool parse_channels(float values[3], const char *text)
77{
78 for (unsigned channel = 0; channel < 3; ++channel) {
79 char token[64];
80 const char *end = strchr(text, ',');
81 const size_t length = end ? (size_t)(end - text) : strlen(text);
82 if (!length || length >= sizeof(token)) return false;
83 for (size_t index = 0; index < length; ++index) token[index] = text[index];
84 token[length] = '\0';
85 double number = 0;
86 if (!ini_real(token, &number) || !isfinite((float)number)) return false;
87 values[channel] = (float)number;
88 if (!end) {
89 if (channel) return channel == 2;
90 values[1] = values[2] = values[0];
91 return true;
92 }
93 text = end + 1;
94 }
95 return false;
96}
97
98/** @brief Parse one indexed tensor while keeping duplicate detection separate for each tensor and direction. */
99static bool tensor_field(struct model_parser *parser, const char *key, const char *value, bool input)
100{
101 const char *number = key + (input ? 6 : 7);
102 const char *separator = strchr(number, '.');
103 char index_text[21];
104 if (!separator || separator == number || (size_t)(separator - number) >= sizeof(index_text)) return false;
105 const size_t length = (size_t)(separator - number);
106 for (size_t index = 0; index < length; ++index) index_text[index] = number[index];
107 index_text[length] = '\0';
108 uint64_t slot = 0;
109 if (!ini_uint(index_text, &slot) || slot >= ONNX_TENSOR_LIMIT) return false;
110 const char *field = separator + 1;
111 struct onnx_tensor *tensor = input ? &parser->model->inputs[slot] : &parser->model->outputs[slot];
112 unsigned char *seen = input ? &parser->inputs[slot] : &parser->outputs[slot];
113 unsigned char bit;
114 if (!strcmp(field, "name")) bit = 1;
115 else if (!strcmp(field, "type")) bit = 2;
116 else if (!strcmp(field, "shape")) bit = 4;
117 else return false;
118 if (*seen & bit) return false;
119 *seen |= bit;
120 if (bit == 1) {
121 char *name = input ? parser->model->input_names[slot] : parser->model->output_names[slot];
122 if (!copy_name(name, ONNX_NAME_CAPACITY, value)) return false;
123 tensor->name = name;
124 return true;
125 }
126 if (bit == 4) return parse_dimensions(tensor, value);
127 static const char *const names[] = {"float32", "uint8", "int8", "int32", "int64", "float64"};
129 for (size_t index = 0; index < sizeof(types) / sizeof(types[0]); ++index) {
130 if (!strcmp(value, names[index])) { tensor->type = types[index]; return true; }
131 }
132 return false;
133}
134
135/** @brief Recognize descriptor policy, not arbitrary network-specific configuration or custom operators. */
136static bool model_field(void *context, const char *key, const char *value)
137{
138 struct model_parser *parser = context;
139 struct inference_model *model = parser->model;
140 if (!strncmp(key, "input.", 6)) return tensor_field(parser, key, value, true);
141 if (!strncmp(key, "output.", 7)) return tensor_field(parser, key, value, false);
142 static const char *const names[] = {"schema", "adapter", "model_sha256", "input_count", "output_count",
143 "image.layout", "image.color", "image.resize", "image.scale", "image.mean", "image.padding",
144 "image.units", "audio.sample_rate", "audio.samples", "image.interpolation", "labels"};
145 size_t field = 0;
146 while (field < sizeof(names) / sizeof(names[0]) && strcmp(key, names[field])) ++field;
147 if (field == sizeof(names) / sizeof(names[0]) || (parser->seen & (UINT32_C(1) << field))) return false;
148 parser->seen |= UINT32_C(1) << field;
149 if (!field) return !strcmp(value, "SENSORAIA_MODEL_V1");
150 if (field == 1) return copy_name(model->adapter, sizeof(model->adapter), value);
151 if (field == 2) return strlen(value) == 64 && strspn(value, "0123456789abcdef") == 64 &&
152 copy_name(model->graph_sha256, sizeof(model->graph_sha256), value);
153 if (field == 15) return !strchr(value, ';') && copy_name(model->labels, sizeof(model->labels), value);
154 if (field == 3 || field == 4 || field == 12 || field == 13) {
155 uint64_t number;
156 if (!ini_uint(value, &number) || !number || number > (field < 5 ? ONNX_TENSOR_LIMIT : 192000U)) return false;
157 if (field == 3) model->input_count = (size_t)number;
158 else if (field == 4) model->output_count = (size_t)number;
159 else if (field == 12) model->audio_rate = (unsigned)number;
160 else model->audio_samples = (unsigned)number;
161 return true;
162 }
163 if (field == 5) {
164 if (!strcmp(value, "nchw")) model->image.layout = INFERENCE_NCHW;
165 else if (!strcmp(value, "nhwc")) model->image.layout = INFERENCE_NHWC;
166 else return false;
167 } else if (field == 6) {
168 model->image.bgr = !strcmp(value, "bgr");
169 model->image.channels = !strcmp(value, "gray") ? 1 : 3;
170 if (strcmp(value, "rgb") && strcmp(value, "bgr") && strcmp(value, "gray")) return false;
171 } else if (field == 7) {
172 model->image.letterbox = !strcmp(value, "letterbox");
173 if (strcmp(value, "letterbox") && strcmp(value, "stretch")) return false;
174 } else if (field == 8 || field == 9) return parse_channels(field == 8 ? model->image.scale : model->image.mean, value);
175 else if (field == 10) {
176 double number;
177 if (!ini_real(value, &number) || !isfinite((float)number)) return false;
178 model->image.padding = (float)number;
179 } else if (field == 11) {
180 if (!strcmp(value, "pixel")) model->image.units = INFERENCE_PIXEL;
181 else if (!strcmp(value, "kelvin64")) model->image.units = INFERENCE_RAW_KELVIN64;
182 else if (!strcmp(value, "kelvin")) model->image.units = INFERENCE_KELVIN;
183 else if (!strcmp(value, "celsius")) model->image.units = INFERENCE_CELSIUS;
184 else return false;
185 } else if (field == 14) return !strcmp(value, "nearest");
186 return true;
187}
188
189bool inference_model_parse(struct inference_model *model, char *contents, size_t length,
190 char *error, size_t capacity)
191{
192 if (!model || !contents || !error || !capacity) return false;
193 *model = (struct inference_model){0};
194 /* Hash the original bytes before destructive parsing so evidence identifies the exact preprocessing contract. */
195 sha256_hex(contents, length, model->descriptor_sha256);
196 struct model_parser parser = {.model = model};
197 if (!ini_parse(contents, length, model_field, &parser) || (parser.seen & 31U) != 31U) goto invalid;
198 size_t total = 0;
199 for (size_t slot = 0; slot < ONNX_TENSOR_LIMIT; ++slot) {
200 const bool input = slot < model->input_count, output = slot < model->output_count;
201 if (parser.inputs[slot] != (input ? 7 : 0) || parser.outputs[slot] != (output ? 7 : 0)) goto invalid;
202 struct onnx_tensor *tensors[] = {&model->inputs[slot], &model->outputs[slot]};
203 for (size_t side = 0; side < 2; ++side) {
204 if ((side == 0 && !input) || (side == 1 && !output)) continue;
205 struct onnx_tensor *tensor = tensors[side];
206 if (!onnx_tensor_bytes(tensor->type, tensor->dimensions, tensor->rank, &tensor->bytes) ||
207 tensor->bytes > ONNX_BUFFER_LIMIT - total) goto invalid;
208 total += tensor->bytes;
209 for (size_t previous = 0; previous < slot; ++previous)
210 if (!strcmp(tensor->name, side ? model->outputs[previous].name : model->inputs[previous].name)) goto invalid;
211 }
212 }
213 if (model->image.channels) {
214 const uint32_t required = (UINT32_C(1) << 5) | (UINT32_C(1) << 6) | (UINT32_C(1) << 7) |
215 (UINT32_C(1) << 8) | (UINT32_C(1) << 9) | (UINT32_C(1) << 11) | (UINT32_C(1) << 14);
216 const struct onnx_tensor *input = &model->inputs[0];
217 if ((parser.seen & required) != required || input->rank != 4 || input->dimensions[0] != 1) goto invalid;
218 const unsigned channel_axis = model->image.layout == INFERENCE_NCHW ? 1 : 3;
219 const unsigned height_axis = model->image.layout == INFERENCE_NCHW ? 2 : 1;
220 const unsigned width_axis = model->image.layout == INFERENCE_NCHW ? 3 : 2;
221 if (input->dimensions[channel_axis] != model->image.channels || input->dimensions[width_axis] > 2048 ||
222 input->dimensions[height_axis] > 2048) goto invalid;
223 model->image.width = (unsigned)input->dimensions[width_axis];
224 model->image.height = (unsigned)input->dimensions[height_axis];
225 model->image.type = input->type;
226 if (input->type != ONNX_FLOAT32 && input->type != ONNX_UINT8 && input->type != ONNX_INT8) goto invalid;
227 for (unsigned channel = 0; channel < model->image.channels; ++channel)
228 if (!model->image.scale[channel]) goto invalid;
229 }
230 error[0] = '\0';
231 return true;
232invalid:
233 snprintf(error, capacity, "Invalid model descriptor: schema, duplicate, tensor bounds or preprocessing contract");
234 return false;
235}
236
237bool inference_model_label(const struct inference_model *model, unsigned category,
238 char *label, size_t capacity)
239{
240 if (!model || !label || !capacity) return false;
241 const char *cursor = model->labels;
242 for (unsigned index = 0; index < category; ++index) {
243 cursor = strchr(cursor, ',');
244 if (!cursor) return false;
245 ++cursor;
246 }
247 const char *end = strchr(cursor, ',');
248 const size_t length = end ? (size_t)(end - cursor) : strlen(cursor);
249 if (!length || length >= capacity) return false;
250 for (size_t index = 0; index < length; ++index) {
251 if ((unsigned char)cursor[index] < 32 || cursor[index] == 127) return false;
252 label[index] = cursor[index];
253 }
254 label[length] = '\0';
255 return true;
256}
257
258bool inference_model_read(struct inference_model *model, const char *descriptor,
259 const char *graph, char *error, size_t capacity)
260{
261 if (!model || !descriptor || !graph || !error || !capacity) return false;
262 char contents[16385], digest[65];
263 size_t length = 0;
264 if (!ini_read_file(descriptor, contents, sizeof(contents), &length)) {
265 snprintf(error, capacity, "Cannot read model descriptor: %s", descriptor);
266 return false;
267 }
268 if (!inference_model_parse(model, contents, length, error, capacity)) return false;
269 /* A well-formed descriptor for a different graph is still an incompatible assignment bundle. */
270 if (!inference_file_sha256(graph, digest) || strcmp(digest, model->graph_sha256)) {
271 snprintf(error, capacity, "Model graph checksum mismatch or unreadable graph: %s", graph);
272 return false;
273 }
274 return true;
275}
276
278 const struct inference_settings *settings, const char *adapter,
279 char *error, size_t capacity)
280{
281 if (!context || !settings || !error || !capacity) return false;
282 error[0] = '\0';
283 if (context->storage || context->session.handle || settings->backend != INFERENCE_ONNX ||
284 !settings->model[0] || !settings->descriptor[0]) {
285 snprintf(error, capacity, "ONNX requires a model and model_descriptor in settings");
286 return false;
287 }
288 if (!inference_model_read(&context->model, settings->descriptor, settings->model, error, capacity)) return false;
289 if (adapter && strcmp(context->model.adapter, adapter)) {
290 snprintf(error, capacity, "Unsupported model adapter: %s (expected %s)", context->model.adapter, adapter);
291 return false;
292 }
293 size_t total = 0;
294 /* Align every tensor independently; mixed numeric types may otherwise receive misaligned storage. */
295 for (size_t side = 0; side < 2; ++side) {
296 const size_t count = side ? context->model.output_count : context->model.input_count;
297 const struct onnx_tensor *tensors = side ? context->model.outputs : context->model.inputs;
298 for (size_t index = 0; index < count; ++index) {
299 const size_t aligned = (tensors[index].bytes + 63U) & ~(size_t)63U;
300 if (aligned > ONNX_BUFFER_LIMIT - total) {
301 snprintf(error, capacity, "Model tensor workspace exceeds bounded storage");
302 return false;
303 }
304 total += aligned;
305 }
306 }
307 if (!total) {
308 snprintf(error, capacity, "Model tensor workspace is empty");
309 return false;
310 }
311 /* POSIX-backed private mapping avoids anonymous-mapping extensions and gives tensor storage a clear lifetime. */
312 const int descriptor = open("/dev/zero", O_RDWR | O_CLOEXEC);
313 if (descriptor < 0) {
314 snprintf(error, capacity, "Cannot open model workspace backing: %s", strerror(errno));
315 return false;
316 }
317 void *storage = mmap(NULL, total, PROT_READ | PROT_WRITE, MAP_PRIVATE, descriptor, 0);
318 const int closed = close(descriptor);
319 if (storage == MAP_FAILED || closed) {
320 if (storage != MAP_FAILED) munmap(storage, total);
321 snprintf(error, capacity, "Cannot map bounded model tensor workspace");
322 return false;
323 }
324 context->storage = storage;
325 context->storage_bytes = total;
326 context->timeout_ms = settings->timeout_ms;
327 size_t offset = 0;
328 for (size_t side = 0; side < 2; ++side) {
329 const size_t count = side ? context->model.output_count : context->model.input_count;
330 struct onnx_tensor *tensors = side ? context->model.outputs : context->model.inputs;
331 for (size_t index = 0; index < count; ++index) {
332 tensors[index].data = (unsigned char *)storage + offset;
333 offset += (tensors[index].bytes + 63U) & ~(size_t)63U;
334 }
335 }
336 const struct onnx_session_options options = {.threads = settings->threads,
337 .library_directory = settings->library_directory};
338 if (!onnx_session_open(&context->session, settings->model, context->model.inputs, context->model.input_count,
339 context->model.outputs, context->model.output_count, &options, error, capacity)) {
341 return false;
342 }
343 return true;
344}
345
346bool inference_context_run(struct inference_context *context, char *error, size_t capacity)
347{
348 if (!context || !context->storage) {
349 if (error && capacity) snprintf(error, capacity, "Inference context is not open");
350 return false;
351 }
352 const uint64_t now = onnx_monotonic_us();
353 if (!now) {
354 if (error && capacity) snprintf(error, capacity, "Monotonic inference clock unavailable");
355 return false;
356 }
357 return onnx_session_run(&context->session, context->timeout_ms ? now + (uint64_t)context->timeout_ms * 1000 : 0,
358 error, capacity);
359}
360
362 const struct inference_image *image,
363 char *error, size_t capacity)
364{
365 if (!context || !context->storage || context->model.input_count != 1 || !context->model.image.channels) {
366 if (error && capacity) snprintf(error, capacity, "Model does not declare a single image input");
367 return false;
368 }
369 return inference_image_prepare(image, &context->model.image, context->model.inputs[0].data,
370 context->model.inputs[0].bytes, &context->transform, error, capacity);
371}
372
374{
375 if (!context) return;
376 /* Session values borrow the mapping, so their destruction must precede munmap. */
377 onnx_session_close(&context->session);
378 if (context->session.handle) return;
379 if (context->storage) munmap(context->storage, context->storage_bytes);
380 *context = (struct inference_context){0};
381}
static bool ini_uint(const char *text, uint64_t *number)
Parse digits-only uint64; overflow and signs are rejected.
Definition bounded_ini.h:52
static bool ini_real(const char *text, double *number)
Parse finite decimal/exponent notation, rejecting range errors and suffixes.
Definition bounded_ini.h:67
static bool ini_read_file(const char *filename, char *buffer, size_t capacity, size_t *length)
Read a nonempty regular file smaller than capacity and append NUL.
Definition bounded_ini.h:98
static bool ini_parse(char *buffer, size_t length, ini_field_handler handler, void *context)
Destructively parse flat fields with blank lines and #/; comment lines.
static unsigned capacity[COVERAGE_CAMERAS]
bool invalid
Definition chdk_pipe.c:145
int descriptor
Definition chdk_pipe.c:142
void(* close)(struct usbfs_handle *)
Definition chdkbridge.c:57
int(* open)(const struct usbfs_device *, struct usbfs_handle *)
Definition chdkbridge.c:56
bool inference_image_prepare(const struct inference_image *image, const struct inference_image_spec *spec, void *tensor, size_t capacity, struct inference_image_transform *transform, char *error, size_t error_capacity)
Convert with the declared nearest-neighbor policy, not a guessed training transform.
@ INFERENCE_NHWC
@ INFERENCE_NCHW
@ INFERENCE_KELVIN
@ INFERENCE_PIXEL
@ INFERENCE_RAW_KELVIN64
@ INFERENCE_CELSIUS
bool inference_context_run(struct inference_context *context, char *error, size_t capacity)
Run the currently prepared tensors using the context's timeout policy.
static bool copy_name(char *destination, size_t capacity, const char *value)
Store an owned bounded name so parser-buffer destruction cannot invalidate tensor views.
static bool parse_channels(float values[3], const char *text)
Accept one shared channel value or exactly three, without silently broadcasting an incomplete pair.
bool inference_context_open(struct inference_context *context, const struct inference_settings *settings, const char *adapter, char *error, size_t capacity)
Verify a bundle, map bounded tensors and bind one warm session.
bool inference_context_prepare_image(struct inference_context *context, const struct inference_image *image, char *error, size_t capacity)
Prepare a single image input without running the model, so camera leases can be released first.
bool inference_file_sha256(const char *filename, char digest[65])
Hash a stable nonempty regular file using bounded streaming scratch.
static bool model_field(void *context, const char *key, const char *value)
Recognize descriptor policy, not arbitrary network-specific configuration or custom operators.
bool inference_model_read(struct inference_model *model, const char *descriptor, const char *graph, char *error, size_t capacity)
Load a bounded descriptor and verify its exact graph digest; hashes are not authentication.
bool inference_model_label(const struct inference_model *model, unsigned category, char *label, size_t capacity)
Resolve one model-owned label without retaining a pointer into a mutable list.
void inference_context_close(struct inference_context *context)
Release the session before unmapping its borrowed tensor storage.
bool inference_model_parse(struct inference_model *model, char *contents, size_t length, char *error, size_t capacity)
Parse a descriptor, not graph bytes; graph integrity remains a separate read-time check.
static bool parse_dimensions(struct onnx_tensor *tensor, const char *text)
Accept concrete positive extents only; export-time dynamic axes need an explicit execution shape.
static bool tensor_field(struct model_parser *parser, const char *key, const char *value, bool input)
Parse one indexed tensor while keeping duplicate detection separate for each tensor and direction.
Integrity-checked model contracts and independently owned tensor workspaces.
@ INFERENCE_ONNX
struct jpeg_error_mgr error
Definition lwir_image.c:60
bool onnx_tensor_bytes(enum onnx_element_type type, const int64_t *dimensions, size_t rank, size_t *bytes)
Compute bounded concrete storage, rejecting unsupported types, dynamic extents and overflow.
bool onnx_session_run(struct onnx_session *session, uint64_t deadline_us, char *error, size_t capacity)
Run once; deadline is absolute CLOCK_MONOTONIC microseconds, or zero for none.
bool onnx_session_open(struct onnx_session *session, const char *model, const struct onnx_tensor *inputs, size_t input_count, const struct onnx_tensor *outputs, size_t output_count, const struct onnx_session_options *options, char *error, size_t capacity)
Validate graph contracts and bind reusable caller buffers; failure releases acquired resources.
uint64_t onnx_monotonic_us(void)
Read the clock used by inference deadlines.
void onnx_session_close(struct onnx_session *session)
Cancel/wait for an active run and release resources; repeated closes are harmless.
#define ONNX_NAME_CAPACITY
#define ONNX_TENSOR_LIMIT
onnx_element_type
Supported numeric types; values match the ONNX Runtime C ABI.
@ ONNX_INT32
@ ONNX_FLOAT32
@ ONNX_FLOAT64
@ ONNX_INT64
@ ONNX_UINT8
@ ONNX_INT8
#define ONNX_BUFFER_LIMIT
#define ONNX_RANK_LIMIT
static size_t count
Definition pose_log.c:79
static FILE * output
Definition pose_log.c:77
bool sha256_file(const char *filename, char output[SHA256_HEX_SIZE])
Hash an immutable nonempty regular file with bounded streaming scratch.
Definition sha256fst.c:286
void sha256_hex(const void *data, size_t length, char *output)
Hash one memory region to a lowercase hexadecimal string.
Definition sha256fst.c:272
Allocation-free, portable SHA-256 checksums for memory and streams.
Independent, noncopyable model owner; mapped tensor buffers and session are reused between jobs.
struct inference_image_transform transform
struct inference_model model
struct onnx_session session
enum inference_layout layout
enum inference_units units
enum onnx_element_type type
Borrowed immutable planes; lengths/strides prove all addressed rows are available.
Parsed descriptor with self-referencing tensor-name pointers; do not copy after parsing.
struct inference_image_spec image
char descriptor_sha256[65]
char input_names[ONNX_TENSOR_LIMIT][ONNX_NAME_CAPACITY]
char output_names[ONNX_TENSOR_LIMIT][ONNX_NAME_CAPACITY]
struct onnx_tensor inputs[ONNX_TENSOR_LIMIT]
struct onnx_tensor outputs[ONNX_TENSOR_LIMIT]
Per-application configuration; all resolved paths belong to this caller-owned value.
enum inference_backend backend
char model[INFERENCE_PATH_CAPACITY]
char descriptor[INFERENCE_PATH_CAPACITY]
char library_directory[INFERENCE_PATH_CAPACITY]
Independent duplicate masks for descriptor-wide and indexed tensor fields.
unsigned char outputs[ONNX_TENSOR_LIMIT]
unsigned char inputs[ONNX_TENSOR_LIMIT]
struct inference_model * model
Explicit execution limits so each model cannot create an unbounded CPU pool.
Named concrete tensor view; its aligned backing storage must outlive the session.
enum onnx_element_type type
int64_t dimensions[ONNX_RANK_LIMIT]
const char * name
Validated capture and reporting policy, fixed before the sample loop.
Definition earcam.c:137
struct captured_image image
Definition usher.c:371