Skip to main content

Crate sightloom

Crate sightloom 

Source
Expand description

Facade crate for SightLoom host integration.

Workspace layout:

  • sightloom-core — geometry, detections, NMS, zones, envelopes
  • sightloom-tracking — ByteTrack-style tracking, smoothers, trajectories
  • sightloom-index — observations, masks, VisionIndex storage
  • sightloom-analysis — zone analytics, patterns, anomalies
  • sightloom-reid — subject references and identity contracts
  • sightloom — 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§

BufferMetricsExporter
Collects metrics into an in-memory buffer (tests / host capture).
DemoSpanDto
Demo-oriented identity + span export row (JSON-friendly).
FrameQueue
Bounded per-host (or per-source) frame queue implementing IngestPolicy depth + DropPolicy.
FrameView
Borrowed view of one host frame (pixels stay with the host).
IndexSession
Host-facing session: multi-source tracker + identity gallery + VisionIndex.
IngestMetrics
Lightweight counters hosts can scrape or export to Prometheus.
IngestPolicy
Host ingest policy for a session or source.
MemoryAutoRebuild
Automatic video-memory rebuild schedule during ingest.
MetricPoint
One counter/gauge sample in a backend-neutral form.
NullMetricsExporter
No-op exporter for tests.
PhotoSearchResult
Photo search hit plus optional evidence reel for host UI.
PhotoView
Borrowed photo / crop buffer for embedding (host owns decode).
QueuedFrame
One pending frame waiting to be ingested (host-side queue item).
RedactionIntervalExportDto
Redaction provenance interval DTO for Intelligence / host audit export.
RedactionPixelSample
One pixel-level redaction evaluation sample (host supplies pixel counts).
RedactionQualityReport
Aggregated redaction quality (host-render evaluation; SightLoom stores intervals only).
ReidQualityReport
Re-id quality snapshot from a calibration report (EER + recommended band).
RetentionPolicy
Host retention / privacy policy.
RetentionReport
Outcome of one retention / forget operation.
SeedResult
Helper used by session seed responses.
SourceTtl
Per-source max age for track samples (relative to that source’s newest pts).
SourceWatermark
Per-source checkpoint watermark.
SpanEvent
Lightweight span-like event for host tracing bridges.
TrackEmbeddingHit
Cosine hit against a track embedding (may be unlabeled).
TrackSpanExport
Host-facing export of one effective track/mask sample (no pixels).
TrackingQualityReport
Tracking quality summary wrapping baseline CLEAR metrics.
UncertainIntervalDto
Uncertain identity interval DTO for host UI.

Enums§

DropPolicy
What to do when the ingest queue is full.
EmbeddingTask
Kind of embedding a host model produces.
IngestDecision
Decision for a candidate frame under policy + watermark.
LateFramePolicy
How to treat frames older than the source watermark.
MetricKind
Metric kind for exporters.
OutOfOrderPolicy
Out-of-order timestamp policy within a source.
PixelFormat
Pixel layout of a host frame buffer (no decode ownership).
QueuePushResult
Result of trying to push into a bounded FrameQueue.
SessionError
Errors raised while materializing a VisionIndex session.
SourceLifecycle
Host-facing source lifecycle event (for adapters / reconnect).
SpanStatus
Span completion status.

Traits§

DetectorAdapter
Host-implemented detector: one frame stamp + pixel view → detections.
MetricsExporter
Host metrics sink (Prometheus remote-write, OpenTelemetry SDK, log, …).
PhotoEmbeddingAdapter
Host-implemented photo → embedding vector adapter.
SpanExporter
Host span/trace sink.
TrackEmbeddingAdapter
Host track re-id embedder for continuous per-frame track vectors.

Functions§

analysis_series_from_index
Builds an AnalysisSeries from 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::CameraGraph from 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 IngestMetrics into 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).