Skip to content

Ui Application Interface

app.ui.interfaces.ui_application_interface

View source code

UI-owned application facade contract consumed by UI handlers.

This protocol lives in the UI layer on purpose: it describes the subset of the concrete Application facade that UI handlers need. It is not a duplicate of the application-layer service contracts; it is the UI's view of the app.

See Also

Layer: Presentation. Context: Defines presentation-facing contracts for controllers, application access, and windows.

UIApplicationInterface

Bases: Protocol

Narrow application facade exposed to UI handlers.

Layer: Presentation. Context: Supports user interaction and delegates application work through presentation contracts.

active_session: InfraSession | None property

Return the currently active session, if any.

RETURNS DESCRIPTION
Session | None

Active session object, or None when no session is active.

active_session_id: SessionId | None property writable

Return the active session identifier, if any.

RETURNS DESCRIPTION
SessionId | None

Active session identifier, or None when no session is active.

apply_filters_to_layer(layer_name: VideoDataLayer, s_id: SessionId) -> None

Reapply confidence and size filters to an editable detection or tracking layer.

PARAMETER DESCRIPTION
layer_name

Editable layer B or D to filter.

TYPE: VideoDataLayer

s_id

Identifier of the session whose layer is updated.

TYPE: SessionId

detect_current_frame(s_id: SessionId) -> None

Run detection on the session's current video frame.

PARAMETER DESCRIPTION
s_id

Identifier of the session to process.

TYPE: SessionId

get_detection_frame_coverage(s_id: SessionId) -> tuple[int, int]

Return processed detection-frame count and video length.

PARAMETER DESCRIPTION
s_id

Session to inspect before tracking.

TYPE: SessionId

get_session_by_id(s_id: SessionId) -> InfraSession

Return the session identified by s_id.

PARAMETER DESCRIPTION
s_id

Identifier of the session to retrieve.

TYPE: SessionId

RETURNS DESCRIPTION
Session

Matching infrastructure session.

session_has_running_tracking_worker(s_id: SessionId) -> bool

Check whether a session's tracking worker is active.

PARAMETER DESCRIPTION
s_id

Identifier of the session to check.

TYPE: SessionId

RETURNS DESCRIPTION
bool

True when its tracking worker is running.

start_detection_worker(s_id: SessionId) -> None

Start background detection for all frames in a session.

PARAMETER DESCRIPTION
s_id

Identifier of the session to process.

TYPE: SessionId

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

Start background tracking for a session using a selected source layer.

PARAMETER DESCRIPTION
s_id

Identifier of the session to track.

TYPE: SessionId

strategy_name

Tracking strategy to run.

TYPE: str

source_layer_name

Detection layer supplying the tracking input.

TYPE: VideoDataLayer

sync_tracking_cache(s_id: SessionId) -> None

Synchronize completed tracking results into the session's tracking layers.

PARAMETER DESCRIPTION
s_id

Identifier of the session whose tracking results are synchronized.

TYPE: SessionId

Side Effects

Replaces immutable layer C and seeds uninitialized layer D frames while preserving edits.

update_session_settings(s_id: SessionId, **kwargs: Unpack[ProcessingSettingsKwargs]) -> None

Update processing settings for a session.

PARAMETER DESCRIPTION
s_id

Identifier of the session to update.

TYPE: SessionId

kwargs

Setting names and replacement values accepted by ProcessingSettings.

TYPE: Unpack[ProcessingSettingsKwargs] DEFAULT: {}