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
loom_onnx_features.c File Reference

Model-identified feature transport independent of IMX500 tensor metadata. More...

#include "loom_features.h"
#include "../../src/inference_model.h"
#include <math.h>
#include <string.h>
Include dependency graph for loom_onnx_features.c:

Go to the source code of this file.

Functions

static void write_u32 (unsigned char *destination, uint32_t value)
 Encode an already-bounds-checked field without unaligned integer stores.
static uint32_t read_u32 (const unsigned char *source)
 Decode an already-bounds-checked field without host-endian or alignment assumptions.
size_t loom_onnx_features_pack (unsigned char *record, size_t capacity, const struct inference_model *model, uint64_t sequence, uint64_t sensor_timestamp_ns)
 Encode a complete LOOMOX01 record without fabricating an IMX500 metadata header.
bool loom_onnx_features_valid (const unsigned char *record, size_t size, const char *model_sha256, const char *descriptor_sha256)
 Validate the exact binary layout and optionally require the same trained feature space.
bool loom_onnx_return_vector (const unsigned char *record, size_t size, const char *model_sha256, const char *descriptor_sha256, float values[3])
 Decode an explicitly declared two/three-value return-vector record.

Detailed Description

Model-identified feature transport independent of IMX500 tensor metadata.

Fixed little-endian fields preserve float bits and feature-space identity across PC/ARM64.

Definition in file loom_onnx_features.c.

Function Documentation

◆ loom_onnx_features_pack()

size_t loom_onnx_features_pack ( unsigned char * record,
size_t capacity,
const struct inference_model * model,
uint64_t sequence,
uint64_t sensor_timestamp_ns )

Encode a complete LOOMOX01 record without fabricating an IMX500 metadata header.

Parameters
recordWritable destination, unchanged when validation rejects the input.
capacityAvailable bytes; records cannot exceed LOOM_ONNX_FEATURE_CAPACITY.
modelCompleted immutable float outputs and their exact graph/descriptor identities.
sequenceSource correlation, retained separately from any flight-controller shot number.
sensor_timestamp_nsPhysical sensor time when available; zero explicitly means unavailable.
Returns
Encoded byte count, or zero for invalid/nonfinite/oversized features.
Precondition
Input tensors and destination do not overlap. This transport does not establish a visual match.

Definition at line 39 of file loom_onnx_features.c.

◆ loom_onnx_features_valid()

bool loom_onnx_features_valid ( const unsigned char * record,
size_t size,
const char * model_sha256,
const char * descriptor_sha256 )

Validate the exact binary layout and optionally require the same trained feature space.

Parameters
recordImmutable LOOMOX01 bytes.
sizeExact record length; truncation and trailing bytes are rejected.
model_sha256Required graph digest, or NULL for structural validation only.
descriptor_sha256Required preprocessing digest, or NULL for structural validation only.
Returns
True for bounded finite features and matching supplied identities, not navigation validity.

Definition at line 102 of file loom_onnx_features.c.

◆ loom_onnx_return_vector()

bool loom_onnx_return_vector ( const unsigned char * record,
size_t size,
const char * model_sha256,
const char * descriptor_sha256,
float values[3] )

Decode an explicitly declared two/three-value return-vector record.

Parameters
recordRetained LOOMOX01 bytes from this JPEG.
sizeExact record length.
model_sha256Required graph identity, or NULL.
descriptor_sha256Required descriptor identity, or NULL.
valuesThree floats: first component, second component, confidence.
Returns
False unless exactly one finite two/three-value tensor is present.

A two-value model has no confidence output; 1 then means valid computation, not a measured probability. Frame semantics remain caller-owned.

Definition at line 142 of file loom_onnx_features.c.

◆ read_u32()

uint32_t read_u32 ( const unsigned char * source)
static

Decode an already-bounds-checked field without host-endian or alignment assumptions.

Definition at line 34 of file loom_onnx_features.c.

◆ write_u32()

void write_u32 ( unsigned char * destination,
uint32_t value )
static

Encode an already-bounds-checked field without unaligned integer stores.

Definition at line 28 of file loom_onnx_features.c.