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>
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
-
record Writable destination, unchanged when validation rejects the input. capacity Available bytes; records cannot exceed LOOM_ONNX_FEATURE_CAPACITY. model Completed immutable float outputs and their exact graph/descriptor identities. sequence Source correlation, retained separately from any flight-controller shot number. sensor_timestamp_ns Physical 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
-
record Immutable LOOMOX01 bytes. size Exact record length; truncation and trailing bytes are rejected. model_sha256 Required graph digest, or NULL for structural validation only. descriptor_sha256 Required 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
-
record Retained LOOMOX01 bytes from this JPEG. size Exact record length. model_sha256 Required graph identity, or NULL. descriptor_sha256 Required descriptor identity, or NULL. values Three 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()
|
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()
|
static |
Encode an already-bounds-checked field without unaligned integer stores.
Definition at line 28 of file loom_onnx_features.c.