You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: annotation_tool/ui/classification/README.md
+57-19Lines changed: 57 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,41 +4,79 @@ This directory contains the specific user interface components designed for the
4
4
5
5
Unlike the previous monolithic structure, this module is split into two specialized sub-packages (`event_editor` and `media_player`) that plug into the application's common workspace.
├── preview.py # Video widget, Slider, Audio logic
19
+
└── controls.py # Navigation buttons
20
+
21
+
```
22
+
23
+
---
24
+
25
+
## 🧩 Modules Detail
8
26
9
27
### 1. `event_editor/` (The Right Panel)
28
+
10
29
**Responsible for:** Dynamic annotation forms, Schema management, and Task controls.
11
30
12
31
***`editor.py`**:
13
-
* Defines **`ClassificationEventEditor`**: The main container for the right side of the screen.
14
-
* Hosts the **Undo/Redo** buttons specific to classification.
15
-
* Contains the **Schema Editor** (Add Head) and the **Manual Annotation Box** (Confirm/Clear).
32
+
* Defines **`ClassificationEventEditor`**: The main container for the right side of the screen.
33
+
* Hosts the **Undo/Redo** buttons specific to classification tasks.
34
+
* Contains the **Schema Editor** (Text input to add new Heads) and the **Manual Annotation Box** (Save/Clear buttons).
35
+
36
+
16
37
***`dynamic_widgets.py`**:
17
-
* Contains the logic to programmatically generate UI elements based on the JSON schema:
18
-
* **`DynamicSingleLabelGroup`**: Generates Radio Buttons for mutually exclusive categories.
19
-
* **`DynamicMultiLabelGroup`**: Generates Checkboxes for multi-select categories.
20
-
***`__init__.py`**: Exposes `ClassificationEventEditor` for external use.
38
+
* Contains the logic to programmatically generate UI elements based on the JSON schema loaded in the Model:
39
+
***`DynamicSingleLabelGroup`**: Generates Radio Buttons for mutually exclusive categories.
40
+
***`DynamicMultiLabelGroup`**: Generates Checkboxes for multi-select categories.
41
+
42
+
43
+
44
+
45
+
***`__init__.py`**:
46
+
* Exposes `ClassificationEventEditor` for external use by the Main Window.
47
+
48
+
21
49
22
50
### 2. `media_player/` (The Center Panel)
51
+
23
52
**Responsible for:** Video rendering, playback controls, and navigation.
24
53
25
54
***`preview.py`**:
26
-
* Defines **`MediaPreview`**: A wrapper around `QMediaPlayer` and `QVideoWidget`.
27
-
* Includes the custom **`ClickableSlider`** for instant seeking and time labels (e.g., `00:05 / 01:30`).
55
+
* Defines **`MediaPreview`**: A wrapper around `QMediaPlayer`, `QAudioOutput`, and `QVideoWidget`.
56
+
* Includes the custom **`ClickableSlider`** for instant seeking and time labels (e.g., `00:05 / 01:30`).
57
+
58
+
28
59
***`controls.py`**:
29
-
* Defines **`NavigationToolbar`**: Hosts the buttons for navigating between clips (Previous/Next Clip) and actions (Previous/Next Action).
60
+
* Defines **`NavigationToolbar`**: Hosts the buttons for navigating between clips (Previous/Next Clip) and actions (Previous/Next Action).
61
+
62
+
30
63
***`__init__.py`**:
31
-
* Exposes **`ClassificationMediaPlayer`**: The assembled widget that combines the preview area and the navigation toolbar into a vertical layout.
64
+
* Exposes **`ClassificationMediaPlayer`**: The assembled widget that combines the preview area and the navigation toolbar into a vertical layout.
65
+
66
+
32
67
33
68
---
34
69
35
-
## 🏗️ Architecture Changes
70
+
## 🏗️ Architecture Integration
36
71
37
-
### Where is `panels.py`?
38
-
The specific `LeftPanel`, `CenterPanel`, and `RightPanel` classes have been refactored:
39
-
1.**Left Panel**: Now uses the generic **`CommonProjectTreePanel`** (located in `ui/common/clip_explorer.py`).
40
-
2.**Center & Right Panels**: Now reside in the `media_player` and `event_editor` folders described above.
41
-
3.**Assembly**: The overall layout is now handled by the **`UnifiedTaskPanel`** (in `ui/common/workspace.py`), which composes these components dynamically.
72
+
### Integration with `UnifiedTaskPanel`
73
+
74
+
This module no longer defines the overall layout (Left/Center/Right). Instead, it provides the components that are injected into the **`UnifiedTaskPanel`** (located in `ui/common/workspace.py`).
75
+
76
+
1.**Left Panel**: Uses the generic **`CommonProjectTreePanel`** (shared with Localization).
77
+
2.**Center Panel**: Uses `ClassificationMediaPlayer` from this module.
78
+
3.**Right Panel**: Uses `ClassificationEventEditor` from this module.
42
79
43
80
### Dynamic UI Generation
44
-
The **`event_editor`** module retains the core capability of adapting to the project's data model. It reads `label_definitions` from the Model and instantiates `Dynamic...LabelGroup` widgets at runtime, ensuring the tool works with any classification schema without code changes.
81
+
82
+
The **`event_editor`** module retains the core capability of adapting to the project's data model. It reads `label_definitions` from the global `AppStateModel` and instantiates `Dynamic...LabelGroup` widgets at runtime. This ensures the tool works with any classification schema (e.g., Soccer, Basketball, Surveillance) without requiring code changes.
0 commit comments