Skip to content

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

One canonical RGB frame.

image is an unbatched, CPU-contiguous torch.uint8 tensor in RGB channel-first layout: [3, height, width]. Construction never casts, moves, or copies the supplied tensor.

image_size property

image_size: tuple[int, int]

Return (height, width).

Axis-aligned xyxy boxes stored as float32[N, 4].

Oriented cxcywha boxes stored as float32[N, 5].

Angles are expressed in radians and intentionally remain unwrapped.

Full-frame boolean masks stored as bool[N, H, W].

image_size property

image_size: tuple[int, int]

Return (height, width).

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

to_aabb_rows() -> Tensor

Serialize AABB detections as [x1,y1,x2,y2,score,class] float32 rows.

to_obb_rows

to_obb_rows() -> Tensor

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

to_aabb_rows() -> Tensor

Serialize AABB tracks as [x1,y1,x2,y2,id,score,class,det_idx] float32 rows.

to_obb_rows

to_obb_rows() -> Tensor

Serialize OBB tracks as [cx,cy,w,h,angle,id,score,class,det_idx] float32 rows.

with_masks

with_masks(masks: MaskBatch) -> Tracks

Return track rows carrying aligned full-frame masks.

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.

validate

validate() -> None

Validate finite camera-space boxes with strictly positive dimensions.

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.

validate

validate() -> None

Validate aligned spatial geometry, confidence, classes, and sample ID.

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.

validate

validate() -> None

Reject invalid intrinsics and nonrigid or reflected camera poses.

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.

select

select(indices: Tensor) -> Tracks3D

Select or reorder aligned 3D tracking rows.

validate

validate() -> None

Validate spatial tracks independently of their visible 2D projections.

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.

sample_id property

sample_id: str

Return the common frame identity.

validate

validate() -> None

Validate both collections and their shared identity metadata.

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.

reset

reset() -> None

Reset tracker and sequence-order state for a new stream.

step

step(frame: Frame) -> PipelineResult

Detect objects and advance the pipeline by one frame.

step_detections

step_detections(
    frame: Frame, detections: Detections
) -> PipelineResult

Bind caller detections to the frame and advance tracking after enrichment.

Optional enrichments requested from a perception pipeline.

The enriched detections and tracks produced for one frame.

__post_init__

__post_init__() -> None

Detach completed attributes from the session's mutable cache.

Track attributes

See Track Attributes for Ollama/vLLM setup, profiles, and completion handling.

Authored extraction settings; inference dependencies load only when used.

__post_init__

__post_init__() -> None

Validate portable settings and detach mutable authored schema data.

Create a session from a profile/config, optionally injecting a test backend.

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.

pending_count property

pending_count: int

Number of batches still awaiting a terminal outcome.

queue_metrics property

queue_metrics: dict[str, int | float]

Aggregate streaming backlog counters, with worker failures surfaced.

stats property

stats: dict[str, int]

Analysis outcome counts plus distinct observed/analyzed track counts.

cancel

cancel() -> None

Cancel in-flight/queued requests and preserve explicit terminal events.

close

close() -> None

Release resources; consume finish() first to retain all outcomes.

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.

reset

reset() -> None

Flush the current sequence and namespace subsequent track identities.

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.

to_dict

to_dict() -> dict[str, Any]

Serialize ownership, provenance, and values without sharing mutable data.

Dataset loader

One canonical sample loaded from a materialized build.

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.