Skip to content

Tracking Worker

app.application.managers.tracking_worker

View source code

Centralizes tracking worker lifecycle transitions per session.

See Also

Layer: Application. Context: Coordinates session-scoped lifecycles for application workers and resources.

TrackingWorkerManager

Canonical owner for tracking worker start/stop/switch transitions.

PARAMETER DESCRIPTION
app_adapter

Adapter that exposes application operations through the expected interface.

TYPE: UIApplicationInterface

worker_factory

Factory used to create the worker managed by this class.

TYPE: TrackingWorkerFactoryInterface

__init__(app_adapter: UIApplicationInterface, worker_factory: TrackingWorkerFactoryInterface) -> None

get_tracked_data(s_id: SessionId) -> ListOfBoxesByFrameIndexAsDict

Return the tracking worker's results for a session.

PARAMETER DESCRIPTION
s_id

Identifier of the session whose results are requested.

TYPE: SessionId

RETURNS DESCRIPTION
ListOfBoxesByFrameIndexAsDict

Tracked boxes grouped by frame index.

RAISES DESCRIPTION
TrackingWorkerNotFoundException

If the session has no tracking worker.

start(s_id: SessionId, strategy_name: str, source_layer_name: str) -> None

Start tracking for a session using detections from a supported source layer.

PARAMETER DESCRIPTION
s_id

Identifier of the session to track.

TYPE: SessionId

strategy_name

Tracking algorithm to run.

TYPE: str

source_layer_name

Source layer A or B containing detections.

TYPE: str

RAISES DESCRIPTION
TrackingWorkerAlreadyRunningException

If the session already has an active tracker.

EmptyLayerException

If the selected source layer contains no detections.

UnsupportedLayerException

If the source layer is not A or B.

stop(s_id: SessionId) -> None

Stop and detach the session's tracking worker, if present.

PARAMETER DESCRIPTION
s_id

Identifier of the session whose tracking worker should stop.

TYPE: SessionId

switch_active_session(old_s_id: SessionId | None, new_s_id: SessionId, strategy_name: str, source_layer_name: str) -> None

Switch the tracking worker to the active session.

PARAMETER DESCRIPTION
old_s_id

Previously active session, or None if there was none.

TYPE: SessionId | None

new_s_id

Session that should become active.

TYPE: SessionId

strategy_name

Tracking algorithm to use for the new active session.

TYPE: str

source_layer_name

Detection layer from which tracking should start.

TYPE: str