Layer
app.application.services.detection.layerDetection layer (Layer B) CRUD operations and filtering.
See Also
DetectionResult— represents machine-generated boxesUnifiedLayerService— coordinates cross-layer operations
Layer: Application. Context: Coordinates domain state and infrastructure to complete application use cases.
DetectionLayerService
Bases: QObject
Manages user-editable detection layer (DataLayer.B) operations.
Responsibilities
- CRUD operations for
DataLayer.Bbounding boxes. - Manual detection creation (Create).
- Copy detections to adjacent frames (Update).
- Apply confidence and label filtering to detections (Update).
- Reset detections (revert to
DataLayer.A) (Update). - Delete detections by key (Delete).
Note
DataLayer.A — Raw immutable detection output (cannot edit).
DataLayer.B — User-editable detections (seeded from A, filtered by settings).
Filters applied via confidence-threshold and chosen-labels list.
All user edits are in Layer B only.
Data Flow:
Detection Model (YOLO, Torch, etc.) → DataLayer.A (raw output).
Apply Filters (confidence, labels) → DataLayer.B (filtered).
User Edits (add, delete, move, relabel) on DataLayer.B.
Export DataLayer.B to video.
| PARAMETER | DESCRIPTION |
|---|---|
app
|
Application adapted for session lookup and manual or filtered detection-layer updates.
TYPE:
|
__init__(app: Application) -> None
add_manual_box_to_layer_b_at_current_frame_index(s_id: SessionId, label: str, bbox_xyxy: BBoxXYXYTuple, color_hex: str = '#00ff00') -> None
Add a manually-drawn bounding detection to the current frame in Layer B.
| PARAMETER | DESCRIPTION |
|---|---|
s_id
|
Session ID.
TYPE:
|
label
|
Object class label (e.g., "person", "car").
TYPE:
|
bbox_xyxy
|
Tuple
TYPE:
|
color_hex
|
Optional color for display (default green).
TYPE:
|
Note
- Creates
BBoxViewModelwith confidence=1.0 (user confidence). - Assigns unique manual ID via
next_annotation_idcounter. - Adds to current frame's Layer B.
- Increments detection ID counter for next manual detection.