Skip to content

Commit 9ad351d

Browse files
Update README.md
Add the description modules
1 parent 0cfe2fc commit 9ad351d

1 file changed

Lines changed: 35 additions & 63 deletions

File tree

annotation_tool/README.md

Lines changed: 35 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# SoccerNet Pro Annotation Tool
22

3-
This project is a professional video annotation desktop application built with **PyQt6**. It features a **triple-mode** architecture supporting:
3+
This project is a professional video annotation desktop application built with **PyQt6**. It features a comprehensive tri-mode architecture supporting **Whole-Video Classification**, **Action Spotting (Localization)**, and **Video Captioning (Description)** tasks.
44

5-
1. **Whole-Video Classification**
6-
2. **Action Spotting (Localization)**
7-
3. **Video Description (Captioning)** [NEW]
8-
9-
The project follows a modular **MVC (Model-View-Controller)** design pattern to ensure separation of concerns between data handling, business logic, and user interface. Recent updates have unified the UI architecture using a composite design pattern and migrated the resource management to a robust **Qt Model/View** architecture.
5+
The project follows a modular **MVC (Model-View-Controller)** design pattern to ensure separation of concerns between data handling, business logic, and user interface. Recent updates have unified the UI architecture using a composite design pattern and migrated resource management to a robust **Qt Model/View** architecture.
106

117
## 📂 Project Structure Overview
128

@@ -39,49 +35,31 @@ annotation_tool/
3935
│ │ ├── loc_file_manager.py
4036
│ │ └── localization_manager.py
4137
│ │
42-
│ └── description/ # [NEW] Logic for Description mode
43-
│ ├── desc_annotation_manager.py # Handles text editor & save logic
44-
│ ├── desc_file_manager.py # Handles JSON I/O for description
45-
│ └── desc_navigation_manager.py # Handles interaction with shared Tree Model
38+
│ └── description/ # [NEW] Logic for Description/Captioning mode
39+
│ ├── desc_annotation_manager.py # Handles Q&A text formatting & saving
40+
│ ├── desc_file_manager.py # JSON I/O & Tree population for Description
41+
│ └── desc_navigation_manager.py # Video playback & tree navigation logic
4642
4743
└── ui/ # [View Layer] Interface definitions
4844
├── common/ # Shared widgets & layouts
4945
│ ├── main_window.py # Main UI Assembler (Stacks Views)
5046
│ ├── workspace.py # Generic 3-Column Layout (UnifiedTaskPanel)
51-
│ ├── clip_explorer.py # Universal Left Sidebar (QTreeView)
47+
│ ├── clip_explorer.py # Universal Sidebar (Project Tree View)
5248
│ ├── project_controls.py # Unified control buttons (Save, Export, etc.)
5349
│ ├── dialogs.py # Pop-up dialogs (Wizard, File Picker)
5450
│ └── welcome_widget.py # Welcome screen
5551
5652
├── classification/ # UI components for Classification
57-
│ ├── media_player/ # [Widget] Center Panel components
58-
│ │ ├── preview.py
59-
│ │ ├── controls.py
60-
│ │ └── __init__.py
61-
│ └── event_editor/ # [Widget] Right Panel components
62-
│ ├── dynamic_widgets.py
63-
│ ├── editor.py
64-
│ └── __init__.py
53+
│ ├── media_player/ # Video Player & Navigation controls
54+
│ └── event_editor/ # Dynamic Radio/Checkbox Schema Editor
6555
6656
├── localization/ # UI components for Localization
67-
│ ├── media_player/ # [Widget] Center Panel components
68-
│ │ ├── preview.py
69-
│ │ ├── timeline.py
70-
│ │ ├── controls.py
71-
│ │ └── __init__.py
72-
│ └── event_editor/ # [Widget] Right Panel components
73-
│ ├── annotation_table.py
74-
│ ├── spotting_controls.py
75-
│ └── __init__.py
57+
│ ├── media_player/ # Timeline & Custom Player
58+
│ └── event_editor/ # Spotting Interface & Annotation Table
7659
7760
└── description/ # [NEW] UI components for Description
78-
├── media_player/ # [Widget] Center Panel components
79-
│ ├── preview.py # Video player with robust loading logic
80-
│ ├── controls.py # Simple playback controls
81-
│ └── __init__.py
82-
└── event_editor/ # [Widget] Right Panel components
83-
├── editor.py # Text editor for Captions/Q&A
84-
└── __init__.py
61+
├── media_player/ # Video Player optimized for Q&A review
62+
└── event_editor/ # Text-based Caption/Q&A Editor
8563
8664
```
8765

@@ -94,14 +72,14 @@ annotation_tool/
9472
These files form the backbone of the application infrastructure.
9573

9674
* **`main.py`**: The bootstrap script. Initializes the `QApplication` and launches the main window.
97-
* **`viewer.py`**: Defines the `ActionClassifierApp` (Main Window). It acts as the primary **Controller**, initializing the shared `ProjectTreeModel` and connecting UI signals to specific Logic Controllers based on the active mode.
75+
* **`viewer.py`**: Defines the `ActionClassifierApp` (Main Window). It acts as the primary **Controller**, initializing the shared `ProjectTreeModel` and connecting UI signals to specific Logic Controllers (Classification, Localization, or Description).
9876
* **`utils.py`**: Utility functions for file handling, natural sorting, and icon generation.
9977

10078
### 2. Models (`/models`)
10179

10280
The **Data Layer**. These files handle the application state, data structures, and validation logic. They are completely decoupled from the UI.
10381

104-
* **`app_state.py`**: The core Application State. Stores runtime data (`manual_annotations`, `localization_events`, `action_item_data`), defines Undo/Redo stacks, and contains strict JSON schema validation logic for all three modes.
82+
* **`app_state.py`**: The core Application State. Stores runtime data (`manual_annotations`, `localization_events`, `action_item_data`), defines Undo/Redo stacks (`CmdType`), and contains strict JSON schema validation logic for all three modes.
10583
* **`project_tree.py`**: The **Qt Standard Item Model**. This is the data source for the project tree. It inherits from `QStandardItemModel` and manages the hierarchical data of clips and source files using standard Qt roles.
10684

10785
### 3. User Interface (`/ui`)
@@ -111,60 +89,54 @@ The **View Layer**. Contains PyQt6 widgets and layout definitions. The UI struct
11189
#### Common Components (`/ui/common`)
11290

11391
* **`main_window.py`**: The top-level UI container. Manages the `QStackedLayout` to switch between Welcome, Classification, Localization, and Description views.
114-
* **`workspace.py`**: Defines `UnifiedTaskPanel`. A generic 3-column skeleton that embeds the shared `CommonProjectTreePanel` on the left.
115-
* **`clip_explorer.py`**: Defines `CommonProjectTreePanel`. The **Shared View** for the project list. Uses `QTreeView` to visualize `ProjectTreeModel`.
92+
* **`workspace.py`**: Defines `UnifiedTaskPanel`. A generic 3-column skeleton that embeds the shared `CommonProjectTreePanel`.
93+
* **`clip_explorer.py`**: Defines `CommonProjectTreePanel`. The **Shared View** for the project list.
94+
* *MVC Update*: Uses `QTreeView` to visualize the `ProjectTreeModel`.
95+
96+
97+
* **`dialogs.py`**: Contains modal dialogs such as the **Project Creation Wizard** (now supports Description mode) and custom **Folder Picker**.
11698
* **`project_controls.py`**: Unified control buttons (Save, Export, Add Video) used in the sidebar.
11799

118100
#### Classification Components (`/ui/classification`)
119101

120-
* **`media_player/`**: Contains the **Center Panel** widgets (Video Player, Slider).
121-
* **`event_editor/`**: Contains the **Right Panel** widgets (Dynamic Radio/Checkbox groups driven by Schema).
102+
* **`media_player/`**: Contains the **Video Playback** widgets (Video Player, Slider, Action Navigation).
103+
* **`event_editor/`**: Contains the **Annotation Interface** widgets (Dynamic Radio/Checkbox groups driven by Schema).
122104

123105
#### Localization Components (`/ui/localization`)
124106

125-
* **`media_player/`**: Contains the **Center Panel** widgets (Timeline, Custom Video Player).
126-
* **`event_editor/`**: Contains the **Right Panel** widgets (Tabbed Spotting Interface, Annotation Table).
107+
* **`media_player/`**: Contains the **Video Playback** widgets (Timeline, Custom Video Player).
108+
* **`event_editor/`**: Contains the **Annotation Interface** widgets (Tabbed Spotting Interface, Annotation Table).
127109

128110
#### Description Components (`/ui/description`) [NEW]
129111

130-
* **`media_player/`**: Contains the **Center Panel** widgets. Features a specialized video player with explicit "Stop-Load-Delay-Play" logic to prevent black screens during rapid navigation.
131-
* **`event_editor/`**: Contains the **Right Panel** widgets. A streamlined text editor that formats `questions` and `captions` metadata into a unified "Q: ... A: ..." block for editing.
112+
* **`media_player/`**: Contains the **Video Playback** widgets tailored for captioning review (Preview Player, Playback Controls).
113+
* **`event_editor/`**: Contains the **Caption Interface** widgets (Text Editor for Q&A/Descriptions, Confirm/Clear controls).
132114

133115
### 4. Controllers (`/controllers`)
134116

135117
The **Logic Layer**. Pure Python logic handling business rules, data manipulation, and bridging Models and Views.
136118

137119
#### Shared Controllers
138120

139-
* **`router.py`**: Handles project lifecycle (Load/Create/Close). Determines which mode to launch (Classification/Localization/Description) based on JSON structure.
121+
* **`router.py`**: Handles project lifecycle (Load/Create/Close). Determines which mode to launch (Classification, Localization, or Description) based on JSON structure.
140122
* **`history_manager.py`**: Manages the Command Pattern implementation for the Undo/Redo system.
141123

142124
#### Classification Sub-module (`/controllers/classification`)
143125

144-
* **`class_file_manager.py`**: Handles JSON I/O. Clears the **Model** directly upon workspace reset.
145-
* **`navigation_manager.py`**: Manages video navigation and filtering via `setRowHidden`.
126+
* **`class_file_manager.py`**: Handles JSON I/O for classification tasks.
127+
* **`navigation_manager.py`**: Manages video navigation and playlist logic.
146128
* **`annotation_manager.py`**: Handles schema logic and saving user selections.
147129

148130
#### Localization Sub-module (`/controllers/localization`)
149131

150-
* **`loc_file_manager.py`**: Handles JSON I/O for localization.
151-
* **`localization_manager.py`**: Core logic for action spotting. Listens to View selection changes to trigger video loading.
132+
* **`loc_file_manager.py`**: Handles JSON I/O for localization tasks.
133+
* **`localization_manager.py`**: Core logic for action spotting and timestamp recording.
152134

153135
#### Description Sub-module (`/controllers/description`) [NEW]
154136

155-
* **`desc_file_manager.py`**: Handles JSON I/O for description/captioning. Parses the `Action -> Inputs` hierarchy and populates the tree.
156-
* **`desc_navigation_manager.py`**: Manages file navigation.
157-
* Implements logic to automatically play child video clips when a parent Action node is selected.
158-
* Includes robust playback logic (Stop -> Load -> Delay -> Play) to ensure stability.
159-
* Handles adding new video files to the project.
160-
161-
162-
* **`desc_annotation_manager.py`**: Manages the right-hand text editor.
163-
* Loads metadata questions and formats them with existing captions.
164-
* Saves edited text back to the model, flattening the structure (removing explicit question keys) upon confirmation.
165-
* Implements auto-advance logic after saving.
166-
167-
137+
* **`desc_file_manager.py`**: Handles JSON I/O for captioning tasks. Populates the tree with `Action -> Inputs` structure and manages saving data back to disk.
138+
* **`desc_navigation_manager.py`**: Manages file navigation and playback logic specific to description tasks (e.g., auto-playing the first clip of an action). Includes robust playback handling (Stop -> Load -> Delay -> Play) to prevent black screens.
139+
* **`desc_annotation_manager.py`**: Handles the Q&A text formatting logic. Parses JSON `questions` and `captions` into a readable text block and flattens edits back into the data model upon confirmation. Supports auto-advance after saving.
168140

169141
### 5. Style (`/style`)
170142

0 commit comments

Comments
 (0)