Skip to content

Commit dfa7513

Browse files
Update README.md
1 parent 7b6a960 commit dfa7513

1 file changed

Lines changed: 57 additions & 19 deletions

File tree

annotation_tool/ui/classification/README.md

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,79 @@ This directory contains the specific user interface components designed for the
44

55
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.
66

7-
## 📂 Directory Structure & Modules
7+
## 📂 Directory Structure
8+
9+
```text
10+
ui/classification/
11+
├── event_editor/ # The "Right Panel" logic
12+
│ ├── __init__.py # Exposes ClassificationEventEditor
13+
│ ├── editor.py # Main container layout
14+
│ └── dynamic_widgets.py # Radio buttons & Checkboxes generators
15+
16+
└── media_player/ # The "Center Panel" logic
17+
├── __init__.py # Exposes ClassificationMediaPlayer
18+
├── preview.py # Video widget, Slider, Audio logic
19+
└── controls.py # Navigation buttons
20+
21+
```
22+
23+
---
24+
25+
## 🧩 Modules Detail
826

927
### 1. `event_editor/` (The Right Panel)
28+
1029
**Responsible for:** Dynamic annotation forms, Schema management, and Task controls.
1130

1231
* **`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+
1637
* **`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+
2149

2250
### 2. `media_player/` (The Center Panel)
51+
2352
**Responsible for:** Video rendering, playback controls, and navigation.
2453

2554
* **`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+
2859
* **`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+
3063
* **`__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+
3267

3368
---
3469

35-
## 🏗️ Architecture Changes
70+
## 🏗️ Architecture Integration
3671

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.
4279

4380
### 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

Comments
 (0)