Expand description
Facade crate for SightLoom host integration.
Workspace layout:
sightloom-core— geometry, detections, NMS, zones, envelopessightloom-tracking— ByteTrack-style tracking, smoothers, trajectoriessightloom-index— observations, masks,VisionIndexstoragesightloom-analysis— zone analytics, patterns, anomaliessightloom-reid— subject references and identity contractssightloom— this facade
detections → tracks → (optional re-id) → zone events → VisionIndex snapshot§Quick start (host owns pixels and models)
use sightloom::core::{Detection, FrameStamp, MediaTime, Rect, SourceId};
use sightloom::tracking::ByteTrackConfig;
use sightloom::{IndexSession, SourceLifecycle};
let mut session = IndexSession::new("demo", ByteTrackConfig::default()).unwrap();
let stamp = FrameStamp::new(
SourceId(1),
0,
MediaTime::new(0, 1_000_000_000).unwrap(),
None,
);
let det = Detection::new(
Rect::new(10.0, 10.0, 40.0, 80.0).unwrap(),
0.9,
None,
None,
)
.unwrap();
session.ingest_detections(stamp, &[det]).unwrap();
// Camera dropped — clear motion state for that source.
session.apply_source_lifecycle(&SourceLifecycle::Reset {
source_id: SourceId(1),
});See also: examples/host_sketch.rs, examples/host_model_stub.rs.
Re-exports§
pub use sightloom_analysis as analysis;pub use sightloom_core as core;pub use sightloom_index as index;pub use sightloom_reid as reid;pub use sightloom_tracking as tracking;
Structs§
- Buffer
Metrics Exporter - Collects metrics into an in-memory buffer (tests / host capture).
- Demo
Span Dto - Demo-oriented identity + span export row (JSON-friendly).
- Frame
Queue - Bounded per-host (or per-source) frame queue implementing
IngestPolicydepth +DropPolicy. - Frame
View - Borrowed view of one host frame (pixels stay with the host).
- Index
Session - Host-facing session: multi-source tracker + identity gallery +
VisionIndex. - Ingest
Metrics - Lightweight counters hosts can scrape or export to Prometheus.
- Ingest
Policy - Host ingest policy for a session or source.
- Memory
Auto Rebuild - Automatic video-memory rebuild schedule during ingest.
- Metric
Point - One counter/gauge sample in a backend-neutral form.
- Null
Metrics Exporter - No-op exporter for tests.
- Photo
Search Result - Photo search hit plus optional evidence reel for host UI.
- Photo
View - Borrowed photo / crop buffer for embedding (host owns decode).
- Queued
Frame - One pending frame waiting to be ingested (host-side queue item).
- Redaction
Interval Export Dto - Redaction provenance interval DTO for Intelligence / host audit export.
- Redaction
Pixel Sample - One pixel-level redaction evaluation sample (host supplies pixel counts).
- Redaction
Quality Report - Aggregated redaction quality (host-render evaluation;
SightLoomstores intervals only). - Reid
Quality Report - Re-id quality snapshot from a calibration report (EER + recommended band).
- Retention
Policy - Host retention / privacy policy.
- Retention
Report - Outcome of one retention / forget operation.
- Seed
Result - Helper used by session seed responses.
- Source
Ttl - Per-source max age for track samples (relative to that source’s newest pts).
- Source
Watermark - Per-source checkpoint watermark.
- Span
Event - Lightweight span-like event for host tracing bridges.
- Track
Embedding Hit - Cosine hit against a track embedding (may be unlabeled).
- Track
Span Export - Host-facing export of one effective track/mask sample (no pixels).
- Tracking
Quality Report - Tracking quality summary wrapping baseline CLEAR metrics.
- Uncertain
Interval Dto - Uncertain identity interval DTO for host UI.
Enums§
- Drop
Policy - What to do when the ingest queue is full.
- Embedding
Task - Kind of embedding a host model produces.
- Ingest
Decision - Decision for a candidate frame under policy + watermark.
- Late
Frame Policy - How to treat frames older than the source watermark.
- Metric
Kind - Metric kind for exporters.
- OutOf
Order Policy - Out-of-order timestamp policy within a source.
- Pixel
Format - Pixel layout of a host frame buffer (no decode ownership).
- Queue
Push Result - Result of trying to push into a bounded
FrameQueue. - Session
Error - Errors raised while materializing a
VisionIndexsession. - Source
Lifecycle - Host-facing source lifecycle event (for adapters / reconnect).
- Span
Status - Span completion status.
Traits§
- Detector
Adapter - Host-implemented detector: one frame stamp + pixel view → detections.
- Metrics
Exporter - Host metrics sink (Prometheus remote-write, OpenTelemetry SDK, log, …).
- Photo
Embedding Adapter - Host-implemented photo → embedding vector adapter.
- Span
Exporter - Host span/trace sink.
- Track
Embedding Adapter - Host track re-id embedder for continuous per-frame track vectors.
Functions§
- analysis_
series_ from_ index - Builds an
AnalysisSeriesfrom index tables (effective track samples preferred). - anomaly_
reason_ label - Summarizes anomaly reasons for host UIs (English labels).
- baseline_
from_ index - Builds a statistical baseline from the index.
- camera_
graph_ from_ topology - Builds an analysis-local
sightloom_analysis::CameraGraphfrom re-id topology. - detect_
anomalies_ from_ index - Detects statistical anomalies against a baseline using the live index series.
- evaluate_
redaction_ pixels - Builds a redaction quality report from host pixel samples.
- evaluate_
stamp - Evaluates late / out-of-order policy for one stamp.
- export_
prometheus - Prometheus text (delegates to ingest helper).
- ingest_
frame_ span - Builds a span for one ingest frame (host fills timestamps / trace ids).
- ingest_
metric_ points - Converts
IngestMetricsinto neutral metric points. - mine_
patterns_ from_ index - Mines patterns from the index and returns new records (does not mutate index).
- otlp_
metrics_ json - OTLP-shaped metrics JSON (resource + scopeMetrics) for host collectors.
- prometheus_
text - Prometheus text exposition for
IngestMetrics(no network; no OpenTelemetry dep). - redaction_
coverage_ gap - Counts planned redaction intervals missing a matching pixel sample id.
- spans_
to_ json - Serializes spans to a JSON array (host OpenTelemetry bridge).