Skip to main content

Crate sightloom_index

Crate sightloom_index 

Source
Expand description

Observations, compact masks, and VisionIndex storage for SightLoom.

SightLoom owns the VisionIndex document. Sibling products own separate documents that must not be mixed in:

  • CaptureProject
  • SemanticEditPlan
  • RenderGraph
  • ExecutionPlan

Modules§

sqlite_query
Query helpers over a saved SQLite event index.

Structs§

AnomalyEvent
Backend-neutral anomaly event exposed to host products.
AnomalyEventDto
Serializable anomaly event.
Appearance
One continuous appearance of a subject on a source timeline.
AppearanceDto
Serializable appearance.
CoOccurrence
Two subjects observed together within a temporal window.
CoOccurrenceDto
Serializable co-occurrence.
CroppedMask
A binary mask cropped to a bounding rectangle in full-frame coordinates.
DenseMask
A dense binary mask with one byte per pixel (0 or non-zero).
EventEnvelopeDto
Serializable event envelope.
EventIndex
In-memory stand-in for the SQLite event/subject index.
EventRecord
One indexed analytics/event row.
EvidenceReel
Evidence reel: ordered segments for one subject (or multi-subject host set).
EvidenceReelBuilder
Builds reels from index data.
EvidenceReelDto
Serializable evidence reel.
Keypoint
One 2D keypoint with optional confidence and class/index tag.
KeypointSet
A set of keypoints for one detection / observation.
KeypointStore
In-memory store of keypoint sets (out-of-line from observations).
MaskStore
In-memory compact mask store.
MediaTimeDto
Serializable media time.
MemoryBuildConfig
Options for materializing appearances and visits.
MemoryManifest
Top-level sidecar package description.
ModelProvenance
Provenance for detections that produced a memory record.
NlParseResult
Successful parse with optional non-fatal warnings.
Observation
A rich, model-neutral observation for video understanding pipelines.
ObservationAttributes
Small fixed set of numeric/boolean attributes attached to an observation.
ObservationDto
Serializable rich observation (revision-aware).
OrientedDetection
Oriented detection for NMS (score + OBB + optional class).
OrientedRect
A center-based oriented rectangle (degrees clockwise from +X).
Page
Pagination cursor.
PatternRecord
Stored pattern record.
PatternRecordDto
Serializable pattern record.
PolygonMask
A polygonal mask stored as validated vertices in full-frame coordinates.
QueryCursor
Cursor state for paginated + incremental subject queries.
RedactionInterval
First-class provenance row for a redaction-relevant media interval.
RedactionIntervalDto
Serializable redaction / provenance interval.
RedactionSpec
Host / re-id input for one provenance interval (no auto appearance link).
ReelId
Opaque reel identifier within one index / session.
ReelSegment
One segment inside an evidence reel (still no pixels).
ReelSegmentDto
Serializable reel segment.
RleMask
A COCO-style row-major RLE mask.
Route
Ordered route summary for a subject (sequence of zone or source hops).
RouteDto
Serializable route.
SourceEntry
One media source recorded in the manifest.
SourceHash
Content hash of a media source for integrity and multi-camera joins.
SourceTransition
Transition of a subject between media sources (multi-camera handoff).
SourceTransitionDto
Serializable source transition.
SpatialHit
One spatial hit (track sample intersecting the region).
SpatialQuery
Axis-aligned region query over effective track samples.
StreamingSubjectQuery
Streaming subject query: holds a filter + cursor.
SubjectHit
One subject row returned by execute_subject_query.
SubjectProfile
Compact long-lived subject profile stored in the index.
SubjectProfileDto
Serializable subject profile.
SubjectQuery
Composable subject-oriented query.
SubjectRank
One ranked subject row.
ThenSeenIn
Require zone A then zone B within a time bound.
TrackArrowBatch
Columnar batch of track samples (Arrow-shaped logical schema).
TrackSample
One track sample suitable for CBOR and Arrow-shaped columnar export.
TrackSampleDto
Serializable track sample.
TrackStream
In-memory append-only track stream (host conveniences).
ValidationIssue
One validation finding with an object path and optional repair hint.
ValidationReport
Full validation report.
VideoMemory
In-memory package convenience wrapper.
VisionIndex
In-memory VisionIndex document.
VisionIndexHeader
Header describing a VisionIndex package on disk or in memory.
VisionIndexPackage
Saves and loads a directory-based VisionIndex package.
VisionIndexSnapshot
Fully serializable materialization of a VisionIndex.
Visit
A visit of a subject to a scene or logical place across one or more sources.
VisitDto
Serializable visit.
ZoneStay
Time spent by a subject or track inside a zone.
ZoneStayDto
Serializable zone stay.

Enums§

AnomalyReason
Machine-readable anomaly reason codes (host maps to UI copy).
MaskError
An error produced by a mask operation.
MemoryError
An error produced by sidecar memory operations.
NlParseError
NL parse failure.
PatternKind
Pattern kind tags.
QueryNode
Boolean query tree.
QueryOrder
Sort order for query results.
RedactionIntent
Host / Intelligence intent for a redaction provenance interval.
Severity
Anomaly severity for host presentation.
SubjectPredicate
Atomic subject predicate.
ValidationSeverity
Severity of a validation finding.

Constants§

CURRENT_FILE
Pointer file naming the active generation directory.
GALLERY_FILE
Optional identity gallery sidecar written by the facade session.
MANIFEST_FILE
Filename used for the package header JSON.
MANIFEST_VERSION
Current manifest schema version written by this crate.
TRACK_ARROW_MAGIC
Codec magic + version for encode_track_arrow / decode_track_arrow.
TRACK_ARROW_VERSION
Current schema version.
VISION_INDEX_VERSION
Schema version written by this crate for VisionIndex documents.

Functions§

append_redaction_intervals
Appends rows to the redaction table.
bbox_to_polygon
Bounding-box rectangle as a trivial four-corner polygon.
build_appearances
Builds appearances from effective track samples.
build_redaction_from_appearances
Builds redaction provenance rows from appearances matching a filter.
build_redaction_from_specs
Builds redaction rows from explicit host-provided interval specs.
build_subject_profiles
Builds SubjectProfile rows from appearances (preferred) or track samples.
build_subject_reel
Convenience: build a coalesced reel for a subject on an index.
build_visits
Builds visits by merging a subject’s appearances across sources.
cropped_mask_iou
Intersection-over-union for two cropped masks in a shared full-frame space.
cropped_to_polygon_approx
Extracts an ordered boundary-ish polygon from a cropped mask’s outer bbox corners.
decode_track_arrow
Decodes SLARROW1 bytes into track samples.
decode_track_arrow_batch
Decodes into a columnar batch.
dense_mask_difference
Pixel-wise difference a \ b into output.
dense_mask_iou
Intersection-over-union for two dense masks of equal size.
dense_mask_union
Pixel-wise union of two equal-size dense masks into output.
dense_to_bbox
Converts a dense mask to its tight axis-aligned bounding box.
dense_to_contour
Traces the outer contour of the first foreground component found.
dense_to_contours
All external contours (one per 4-connected component, outer only).
dense_to_rle
Encodes dense bytes into RLE (see RleMask::encode_from_dense).
dilate
Dilates a dense mask with a square odd kernel of radius pixels.
effective_observations
Effective observation view: rows not superseded by a later observation.
encode_track_arrow
Encodes samples as SLARROW1 bytes.
encode_track_arrow_batch
Encodes a columnar batch.
erode
Erodes a dense mask with a square odd kernel of radius pixels.
execute_query_ast
Executes a boolean query AST, returning subject hits.
execute_spatial_query
Returns effective track samples whose boxes intersect the spatial region.
execute_subject_query
Executes a SubjectQuery against an in-memory index.
feather
Soft feathering: distance-like alpha falloff inside radius of the edge.
fill_holes
Fills enclosed background holes entirely surrounded by foreground.
mask_nms_by_iou
Mask-level NMS scores: each entry is (score, mask_index).
most_frequent_subject
Returns the single most frequent subject, if any samples are labeled.
observation_idempotency_seen
True when key != 0 already appears on any observation (host idempotency).
oriented_aabb_iou
Approximate oriented box overlap via AABB of each OBB (fast host prefilter).
oriented_iou
Exact-ish oriented box IoU via convex polygon intersection (Sutherland–Hodgman).
oriented_nms_aabb
Hard NMS on oriented detections using AABB-IoU approximation.
parse_nl_query
Parses a restricted English query string into a QueryNode.
polygon_to_dense
Rasterizes a polygon mask into a dense buffer of size width * height.
rank_subjects_by_frequency
Ranks subjects by sample count (most frequent first).
rebuild_memory_entities
Rebuilds appearances and visits on the index from effective track samples.
rebuild_subject_profiles
Rebuilds index.subjects from appearances (or tracks). Preserves labels / embeddings. Returns profile count.
rle_to_dense
Decodes RLE into dense bytes (see RleMask::decode_into).
set_redaction_intervals
Replaces index.redaction_intervals with rows (idempotent assign).
source_entry
Helper to attach an optional content hash to a source entry at construction.