Optional serialized LWIR model adapter, separate from USB capture and calibration. More...
#include "inference_settings.h"

Go to the source code of this file.
Functions | |
| bool | lwir_inference_open (const struct inference_settings *settings, double threshold, unsigned category, char *error, size_t capacity) |
| Open one explicit LWIR classifier with a declared pixel or radiometric input domain. | |
| bool | lwir_inference_image (const char *filename, unsigned long long sequence, char *error, size_t capacity) |
| Classify one immutable JPEG/temperature plane and exclusively publish its model-identified sidecar. | |
| void | lwir_inference_close (void) |
| Release the serialized classifier; repeated closes are harmless. | |
Detailed Description
Optional serialized LWIR model adapter, separate from USB capture and calibration.
Built only with LWIR_ENABLE_ANALYSIS. Analyses an already saved photo and writes a separate sidecar; a failed analysis never affects the photograph.
Definition in file lwir_inference.h.
Function Documentation
◆ lwir_inference_close()
| void lwir_inference_close | ( | void | ) |
Release the serialized classifier; repeated closes are harmless.
Release the serialized classifier; repeated closes are harmless.
Definition at line 139 of file lwir_inference.c.
◆ lwir_inference_image()
| bool lwir_inference_image | ( | const char * | filename, |
| unsigned long long | sequence, | ||
| char * | error, | ||
| size_t | capacity ) |
Classify one immutable JPEG/temperature plane and exclusively publish its model-identified sidecar.
- Parameters
-
filename JPEG whose original compressed pixels and temperature evidence are never rewritten. sequence Producer correlation number, not proof of exposure synchronization. error Writable failure diagnostic. capacity Available bytes in error.
- Returns
- True for complete inference/publication; false never invalidates the retained photograph.
Sidecar is "<name>.lwir.ini" beside "<name>.jpg", created exclusively, so an existing sidecar makes the call fail instead of being replaced.
Classify one immutable JPEG/temperature plane and exclusively publish its model-identified sidecar.
- Returns
- True once the sidecar is fully written and fsynced. False if the model is not open, input is missing/invalid, any probability is outside [0,1], hashing fails, or the sidecar exists or cannot be written (a partial sidecar is removed). The photograph is untouched in every case.
Records image and model hashes, input units, synthetic-temperature flag, source size, class, probability and accepted (probability >= threshold).
- Note
- synthetic_temperature is only meaningful for temperature-input models; pixel-input models always record 0.
- The image hash is computed after inference by a separate file read.
Definition at line 83 of file lwir_inference.c.
◆ lwir_inference_open()
| bool lwir_inference_open | ( | const struct inference_settings * | settings, |
| double | threshold, | ||
| unsigned | category, | ||
| char * | error, | ||
| size_t | capacity ) |
Open one explicit LWIR classifier with a declared pixel or radiometric input domain.
- Parameters
-
settings Resolved ONNX settings owned by the caller. threshold Inclusive probability gate in [0,1]. category Index within the model's finite probability vector. error Writable failure diagnostic. capacity Available bytes in error.
- Returns
- True for a qualified classifier contract, not calibrated temperatures or detection accuracy.
- Precondition
- Calls are serialized by the capture/analysis owner; configure before acquiring a live stream.
- Note
erroris overwritten even on success. Once open, later calls return true without applying newthresholdorcategory; close first to change them.
Open one explicit LWIR classifier with a declared pixel or radiometric input domain.
- Returns
- True if open (or already open); false on bad arguments, open failure or an unsupported model contract, leaving nothing open.
Requires exactly one input and one float32 output of at most 4096 classes containing category; non-pixel (temperature) inputs must be single channel.
- Note
- Already open: returns true immediately and keeps the earlier threshold/category.
Definition at line 49 of file lwir_inference.c.