Expand description
Host model package for sightloom.
§Product boundary
SightLoom does not turn photos into embeddings. This crate is the
host side of the killer path:
photo / frame
→ host detect / embed (reference or ONNX)
→ SightLoom IndexSession (rank / memory / tracks)Weights, GPU runtimes, and model download policies live here (or in a
private host binary), never inside sightloom-core.
§Features
| Feature | What |
|---|---|
std (default) | host package + reference models |
onnx | tract ONNX backends ([OnnxEmbedder], [OnnxDetector]) |
download | [HttpModelFetcher] for ModelSpec.uri |
image-decode | JPEG/PNG → RGB for encoded photos |
full | onnx + download + image-decode |
§Steps
- Config, preprocess, reference models,
HostPipeline(enroll_photo/search_photo_jpeg/ingest_frame/save_package) - ONNX load from cache /
ModelSpec.local_path(HostPipeline::from_onnx_cache/from_manifest, featureonnx) (YOLO detect:PreprocessConfig::yolo_detect+decode_detector_output) - Evidence packs — MOT / re-id / redaction / anomaly FAR
- FAR + scoped anomaly baselines
- Download + image decode + analysis day-of-week seasonality
- Weights cookbook —
ModelManifest, SHA-256 integrity, host docs TrackEvalbridge — parse/exportMOTChallenge, import host summaries
Re-exports§
pub use evidence::AnomalyEvidence;pub use evidence::EvidencePack;pub use evidence::EvidencePackPaths;pub use evidence::MotEvidence;pub use evidence::RedactionEvidence;pub use evidence::ReidEvidence;pub use evidence::build_synthetic_anomaly_evidence;pub use evidence::build_synthetic_evidence_pack;pub use evidence::build_synthetic_mot_evidence;pub use evidence::build_synthetic_redaction_evidence;pub use evidence::build_synthetic_reid_evidence;pub use evidence::write_evidence_pack;
Modules§
- evidence
- Step-3 evidence packs: portable MOT / re-id / redaction reports.
Structs§
- Decoded
Rgb - Decoded RGB8 raster ready for preprocess / embed.
- Deferred
Download Fetcher - Fetcher that records requested downloads but does not fetch (offline stub).
- Detector
Decode Config - Thresholds for decode + NMS.
- Filesystem
Fetcher - Only uses
local_pathorcache_dir / id; never hits the network. - Frame
View - Re-export facade types commonly used by host binaries. Borrowed view of one host frame (pixels stay with the host).
- Host
Bundle Config - Full host bundle: which models participate in photo search / ingest.
- Host
Pipeline - Runs the killer path with host embedders +
SightLoomranking. - Index
Session - Re-export facade types commonly used by host binaries.
Host-facing session: multi-source tracker + identity gallery +
VisionIndex. - Letterbox
- Maps network-space boxes back to the source frame.
- Model
Manifest - Versioned list of host models (download / local placement policy).
- Model
Spec - One model the host may load (weights not shipped in
SightLoomcore). - Photo
View - Re-export facade types commonly used by host binaries. Borrowed photo / crop buffer for embedding (host owns decode).
- Preprocess
Config - ImageNet-style or custom normalize + resize plan.
- RawBox
- One decoded box in network pixel space (
x1,y1,x2,y2). - Reference
Embedder - Deterministic embedding from RGB (or encoded bytes fingerprint).
- Reference
Face Detector - Face detector stub: smaller centered box when pixels present.
- Reference
Host Models - Bundled reference detectors + embedders for e2e demos.
- Reference
Person Detector - Deterministic person detector: one full-frame box when any non-zero pixel exists.
- Resolved
Model - Result of materializing one model for logging / evidence.
Enums§
- Device
Preference - Where the host prefers to run a model.
- Embedding
Task - Re-export facade types commonly used by host binaries. Kind of embedding a host model produces.
- Host
Error - Errors from host model config, registry, preprocess, or adapters.
- Model
Task - High-level model task in the host package.
- Pixel
Format - Re-export facade types commonly used by host binaries. Pixel layout of a host frame buffer (no decode ownership).
Traits§
- Detector
Adapter - Re-export facade types commonly used by host binaries. Host-implemented detector: one frame stamp + pixel view → detections.
- Model
Fetcher - Resolves a
ModelSpecto a local file path. - Photo
Embedding Adapter - Re-export facade types commonly used by host binaries. Host-implemented photo → embedding vector adapter.
- Track
Embedding Adapter - Re-export facade types commonly used by host binaries. Host track re-id embedder for continuous per-frame track vectors.
Functions§
- crop_
rgb8 - Crops an axis-aligned box from packed RGB8 (clamped to image).
- decode_
detector_ output - Decodes a flattened detector tensor into network-space boxes.
- decode_
encoded_ rgb - Stub when
image-decodeis off. - decode_
photo_ rgb - Decodes a photo into RGB8.
- detections_
from_ raw_ boxes - Maps network-space boxes to source-frame
Detections and applies NMS. - ensure_
cache_ dir - Creates cache directory if needed.
- file_
sha256_ hex - Computes lowercase hex SHA-256 of a file.
- frame_
to_ rgb8 - Converts a
FrameViewinto packed RGB8 (host preprocess helper). - letterbox_
rgb8 - Letterbox packed RGB8 into
net_w × net_hwith a constant pad. - maybe_
verify_ sha256 - When
expectedisSome, verifies; otherwise no-op. - prepare_
rgb8_ nchw - Resize then normalize in one shot.
- prepare_
rgb8_ nchw_ with_ meta - Resize (or letterbox) then normalize. Returns the mapping used for boxes.
- resize_
rgb8_ nearest - Nearest-neighbor resize of packed RGB8 → packed RGB8 at
out_w × out_h. - resolve_
manifest - Resolves all models and returns structured results.
- rgb8_
to_ chw_ f32 - RGB8 packed → CHW
f32with mean/std (and optional /255). - verify_
file_ sha256 - Verifies
pathagainst an expected lowercase (or mixed-case) hex SHA-256. - write_
cache_ readme - Writes a placeholder marker file documenting where real weights go.