Skip to content

boxmot.trackers.common.track_state

BoxTrack

BoxTrack(
    det,
    *,
    id_allocator: TrackIdAllocator,
    max_obs: int,
    is_obb: bool = False,
    motion_model: MotionModelAdapter,
)

Bases: TrackLifecycleMixin

Common lifecycle and geometry substrate for box-track objects.

Algorithm-specific subclasses still own their motion measurement format and optional appearance/class-history updates.

common_tracked_state class-attribute

common_tracked_state: TrackState = TRACKED

history_observations instance-attribute

history_observations = deque([], maxlen=max_obs)

id_allocator instance-attribute

id_allocator = id_allocator

is_activated instance-attribute

is_activated = False

is_obb instance-attribute

is_obb = bool(is_obb)

kalman_filter instance-attribute

kalman_filter = None

max_obs instance-attribute

max_obs = int(max_obs)

motion_model instance-attribute

motion_model = motion_model

tracked_state class-attribute

tracked_state: object | None = None

tracklet_len instance-attribute

tracklet_len = 0

xywha property

xywha: ndarray

Return the current track box as (cx, cy, w, h, angle).

xyxy property

xyxy: ndarray

Return the current track box as (x1, y1, x2, y2).

activate

activate(kalman_filter, frame_id)

Activate a new track.

multi_predict classmethod

multi_predict(stracks, *, dt: float | None = None) -> None

Batch shared filters and predict independently owned histories directly.

multi_update classmethod

multi_update(
    pairs,
    frame_id: int,
    *,
    reactivate: bool = False,
    new_id: bool = False,
) -> None

Correct shared batches or owned states before ordered lifecycle hooks.

obb_to_xyxy classmethod

obb_to_xyxy(box: ndarray) -> ndarray

Return the enclosing AABB for an OBB box.

predict

predict(*, dt: float | None = None) -> None

Propagate this track over an optional elapsed time interval.

re_activate

re_activate(new_track, frame_id, new_id=False)

Re-activate a track with a new detection.

update

update(new_track, frame_id)

Update the current track with a matched detection.

SortBoxTrack

Bases: TrackLifecycleMixin

Shared identity, counters, and metadata for SORT-style per-object tracks.

common_initial_state class-attribute

common_initial_state: TrackState = TENTATIVE

observation_centric class-attribute

observation_centric: bool = False