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
This directory contains the business logic of the **SoccerNet Pro Annotation Tool**.
4
-
Following the **MVC (Model-View-Controller)** architecture, these scripts act as the bridge between the data (`models.py`) and the interface (`ui/`). They handle user input, data processing, file I/O, and application state management.
3
+
This directory contains the business logic of the **SoccerNet Pro Annotation Tool**. following the **MVC (Model-View-Controller)** architecture, these scripts act as the bridge between the data (`models.py`) and the interface (`ui/`). They handle user input, data processing, file I/O, and application state management.
5
4
6
5
## 📂 Directory Structure
7
6
8
7
```text
9
8
controllers/
9
+
├── media_controller.py # [NEW] Unified Video Playback Manager
├── router.py # Application routing and mode switching
12
12
├── classification/ # Logic specific to Whole-Video Classification
13
-
└── localization/ # Logic specific to Action Spotting (Localization)
13
+
├── localization/ # Logic specific to Action Spotting (Timestamps)
14
+
├── description/ # Logic specific to Global Captioning (Text)
15
+
└── dense_description/ # Logic specific to Dense Captioning (Timestamped Text)
14
16
15
17
```
16
18
@@ -20,23 +22,33 @@ controllers/
20
22
21
23
### 1. Core Controllers (Root)
22
24
23
-
These controllers provide foundational functionality used across the entire application.
25
+
These controllers provide foundational functionality used across the entire application to ensure stability and consistency.
26
+
27
+
***`media_controller.py`**
28
+
***Role**: The centralized video playback engine used by all modes.
29
+
***Responsibilities**:
30
+
***Robust State Management**: Implements a strict `Stop -> Clear -> Load -> Delay -> Play` sequence to prevent black screens and buffer artifacts.
31
+
***Race Condition Prevention**: Uses an internal `QTimer` that is explicitly cancelled upon stop, preventing videos from starting in the background after a user has closed a project.
32
+
***Visual Clearing**: Forces the `QVideoWidget` to repaint/update on stop, ensuring no "stuck frames" remain visible.
33
+
34
+
35
+
24
36
25
37
***`router.py`**
26
38
***Role**: The "Traffic Cop" of the application.
27
39
***Responsibilities**:
28
-
* Handles the "Create Project" and "Load Project" flows.
29
-
* Analyzes input JSON files to determine if the project is **Classification** or **Localization**.
30
-
* Initializes the appropriate specific managers and switches the UI view accordingly.
40
+
* Handles the "Create Project" and "Load Project" flows.
41
+
* Analyzes input JSON files (keys like `events`, `captions`, `labels`) to automatically detect the project mode.
42
+
* Initializes the appropriate specific managers and switches the UI view.
31
43
32
44
33
45
34
46
35
47
***`history_manager.py`**
36
48
***Role**: The "Time Machine" (Undo/Redo System).
37
49
***Responsibilities**:
38
-
* Implements the **Command Pattern** to manage the Undo/Redo stacks in `AppStateModel`.
39
-
* Executes undo/redo operations and triggers the necessary UI refreshes (`_refresh_active_view`) depending on whether the user is in Classification or Localization mode.
50
+
* Implements the **Command Pattern** to manage the Undo/Redo stacks in `AppStateModel`.
51
+
* Executes operations and triggers the necessary UI refreshes (`_refresh_active_view`) for all four modes.
40
52
41
53
42
54
@@ -46,35 +58,49 @@ These controllers provide foundational functionality used across the entire appl
46
58
47
59
Logic dedicated to the **Whole-Video Classification** task (assigning attributes to an entire video clip).
48
60
49
-
***`class_file_manager.py`**
50
-
* Handles JSON I/O for classification projects.
51
-
* Manages relative path calculations for portability.
52
-
* Resets the workspace when closing projects.
61
+
***`class_file_manager.py`**: Handles JSON I/O and relative path calculations.
62
+
***`navigation_manager.py`**: Manages the "Action List" (Left Panel), auto-play logic, and filtering.
63
+
***`annotation_manager.py`**: Manages dynamic schema logic (Radio/Checkbox generation) and saves class selections.
Logic dedicated to the **Action Spotting** task (pinpointing specific timestamps within a video).
97
+
Logic dedicated to the **Dense Captioning** task (text descriptions anchored to specific timestamps).
69
98
70
-
***`loc_file_manager.py`**
71
-
* Handles JSON I/O for localization projects.
72
-
* Includes **Path Fallback** logic: if an absolute path in the JSON is missing, it attempts to find the video in the local directory to support cross-device collaboration.
99
+
***`dense_manager.py`**:
100
+
***Editor-Timeline Sync**: Continuously synchronizes the text input field with the video playback position. If the video hits an event, the text loads automatically.
101
+
***CRUD**: Handles creating, updating, and deleting timestamped text events.
73
102
74
103
75
-
***`localization_manager.py`**
76
-
***Role**: The central hub for the Localization UI.
77
-
***Responsibilities**:
78
-
* Synchronizes the **Video Player**, **Timeline Widget**, and **Event Table**.
79
-
* Captures timestamps when users trigger a spotting event.
80
-
* Manages the Multi-Tab interface for different event categories.
104
+
***`dense_file_manager.py`**:
105
+
***Metadata Preservation**: Ensures global and item-level metadata is retained during Load/Save cycles.
106
+
***Data Mapping**: Maps the flat `dense_captions` JSON list to the internal application model.
0 commit comments