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/README.md
+35-63Lines changed: 35 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,8 @@
1
1
# SoccerNet Pro Annotation Tool
2
2
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.
4
4
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.
10
6
11
7
## 📂 Project Structure Overview
12
8
@@ -39,49 +35,31 @@ annotation_tool/
39
35
│ │ ├── loc_file_manager.py
40
36
│ │ └── localization_manager.py
41
37
│ │
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
46
42
│
47
43
└── ui/ # [View Layer] Interface definitions
48
44
├── common/ # Shared widgets & layouts
49
45
│ ├── main_window.py # Main UI Assembler (Stacks Views)
└── 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
85
63
86
64
```
87
65
@@ -94,14 +72,14 @@ annotation_tool/
94
72
These files form the backbone of the application infrastructure.
95
73
96
74
***`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).
98
76
***`utils.py`**: Utility functions for file handling, natural sorting, and icon generation.
99
77
100
78
### 2. Models (`/models`)
101
79
102
80
The **Data Layer**. These files handle the application state, data structures, and validation logic. They are completely decoupled from the UI.
103
81
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.
105
83
***`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.
106
84
107
85
### 3. User Interface (`/ui`)
@@ -111,60 +89,54 @@ The **View Layer**. Contains PyQt6 widgets and layout definitions. The UI struct
111
89
#### Common Components (`/ui/common`)
112
90
113
91
***`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**.
116
98
***`project_controls.py`**: Unified control buttons (Save, Export, Add Video) used in the sidebar.
***`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).
132
114
133
115
### 4. Controllers (`/controllers`)
134
116
135
117
The **Logic Layer**. Pure Python logic handling business rules, data manipulation, and bridging Models and Views.
136
118
137
119
#### Shared Controllers
138
120
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.
140
122
***`history_manager.py`**: Manages the Command Pattern implementation for the Undo/Redo system.
* 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.
0 commit comments