Public API Reference
The supported Python surface is split by ownership. Heavy model and native runtimes remain lazy until their factories—or a ReID-enabled tracker adapter's live embedding path—are invoked.
Structures
Oriented cxcywha boxes stored as float32[N, 5].
Angles are expressed in radians and intentionally remain unwrapped.
Detection rows and optional row-aligned perception enrichments.
sample_id may be omitted for direct tracking or frame-paired pipelines.
Trackers resolve missing identity from the current inputs or update index.
Persisted detections require an explicit dataset sample identity.
select
select(indices: Tensor) -> Detections
Select or reorder rows while preserving every aligned field.
to_aabb_rows
Serialize AABB detections as [x1,y1,x2,y2,score,class] float32 rows.
to_obb_rows
Serialize OBB detections as [cx,cy,w,h,angle,score,class] float32 rows.
with_embeddings
with_embeddings(embeddings: Tensor) -> Detections
Return a detection batch enriched with aligned appearance vectors.
with_instance_ids
with_instance_ids(
instance_ids: tuple[str, ...],
) -> Detections
Return a detection batch carrying stable row-aligned instance IDs.
with_masks
with_masks(masks: MaskBatch) -> Detections
Return a detection batch enriched with aligned full-frame masks.
Tracker outputs with optional full-frame masks aligned to track rows.
select
select(indices: Tensor) -> Tracks
Select or reorder rows while preserving track-aligned masks.
to_aabb_rows
Serialize AABB tracks as [x1,y1,x2,y2,id,score,class,det_idx] float32 rows.
to_obb_rows
Serialize OBB tracks as [cx,cy,w,h,angle,id,score,class,det_idx] float32 rows.
Sensor fusion structures
Use these values with EagerMot. Image and spatial observations are independent batches; output collections share track IDs rather than row positions.
Float32 [N,7] boxes: x,y,z,yaw,length,width,height in meters/radians.
Coordinates follow the rectified-camera convention: x right, y down, z forward. The position is the bottom-face center; yaw rotates about +y. Construction preserves the caller's CPU-contiguous tensor without copying.
select
select(indices: Tensor) -> Boxes3D
Select or reorder boxes while retaining the spatial convention.
Independent 3D detector rows; their count need not match 2D detections.
sample_id may be omitted; the tracker resolves it together with the
paired 2D detections and optional frame.
select
select(indices: Tensor) -> Detections3D
Select or reorder only this independent detector's rows.
One pinhole camera's projection, image size, and optional rigid pose.
projection is float32 [3,4] and maps homogeneous camera-space
points to pixels after division by depth. image_size is (height,
width). Optional float32 [4,4] camera_to_world maps these points
to a fixed world frame using a rigid rotation and translation. Roll and
pitch are accepted; a tracker with yaw-only boxes approximates their
orientation while transforming box centers with the complete pose.
None denotes a stationary camera with the identity transform.
Camera-space 3D track rows, including objects outside the image view.
detection_indices refers to the independent current Detections3D batch,
with -1 for tracks without a current 3D observation.
Independent image and spatial outputs sharing one track-ID namespace.
The collections can differ in length: an off-camera 3D object needs no artificial image box. Matching IDs identify the same object in both views.
Pipelines
Progressively enrich batches of canonical detections.
enrich
enrich(
frames: Sequence[Frame],
detections: Sequence[Detections],
requirements: TrackerRequirements = TrackerRequirements(),
) -> list[Detections]
Bind unidentified detections to their frames and attach required payloads.
process
process(frames: Sequence[Frame]) -> list[Detections]
Detect and enrich an ordered frame batch according to requested outputs.
Run perception and tracking for one caller-owned frame at a time.
step_detections
step_detections(
frame: Frame, detections: Detections
) -> PipelineResult
Bind caller detections to the frame and advance tracking after enrichment.
Track attributes
See Track Attributes for Ollama/vLLM setup, profiles, and completion handling.
Collect crops without waiting for inference and expose completed attributes.
Use poll() during tracking and iterate finish() at normal EOF to
consume all outcomes, including results for departed tracks. reset()
isolates a new sequence without losing the old sequence's queued work.
The context manager drains on normal exit and cancels on exceptional exit.
Backend ownership transfers when the worker starts successfully.
queue_metrics
property
Aggregate streaming backlog counters, with worker failures surfaced.
stats
property
Analysis outcome counts plus distinct observed/analyzed track counts.
finish
finish() -> Iterator[AttributeResult]
Stop submissions and yield remaining outcomes until every job finishes.
There is no global drain deadline. Individual requests retain their
configured timeout and retry limit. Interrupting iteration allows the
owner to call cancel() and consume cancellation events with poll.
poll
poll(limit: int = 100) -> list[AttributeResult]
Consume up to limit outcomes, including departed/old-sequence tracks.
update
update(
frame: Frame, tracks: Tracks
) -> dict[int, AttributeResult]
Persist eligible sampled crops and return detached current-track results.
A detached result envelope; model output cannot choose its owner.
from_dict
classmethod
from_dict(payload: Mapping[str, Any]) -> AttributeResult
Restore one result snapshot without aliasing persisted values.
Dataset loader
Bases: Sequence[DatasetSample]
Read a versioned build and join optional data by stable instance key.
Parameters:
-
build(str | Path) –Explicit path to the immutable dataset build.
-
split(str | None, default:None) –Optional exact split filter.
-
load_images(bool, default:False) –Decode image references into canonical :class:
Frames. -
load_masks(bool, default:False) –Decode the keyed bit-packed mask table.
-
load_embeddings(bool, default:False) –Load the keyed embedding table.