Skip to content

Commit 2bf555f

Browse files
Update README.md
1 parent bd91059 commit 2bf555f

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

  • annotation_tool/controllers/dense_description
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
1+
# 🧠 Controllers: Dense Description
12

3+
This directory contains the business logic for the **Dense Description** mode (Timestamped Captioning).
4+
5+
This mode is a hybrid of **Localization** (time-based events) and **Description** (free-text generation). The controllers here manage the synchronization between the video playback, the scrolling timeline, and the text input field.
6+
7+
## 📂 Files
8+
9+
### `dense_manager.py`
10+
11+
**The Primary Orchestrator.**
12+
This class connects the UI components (`DenseRightPanel`, `Timeline`, `MediaPlayer`) to the Data Model (`AppState`).
13+
14+
* **Key Responsibilities:**
15+
* **Editor-Timeline Sync:** Uses a `QTimer` (`_sync_editor_to_timeline`) to continuously check the playback position. If the video hits an existing event, the text editor is automatically populated with that event's text.
16+
* **CRUD Operations:** Handles creating, updating, and deleting events via `CmdType` for full **Undo/Redo** support.
17+
* **Tree Management:** Populates the sidebar tree and handles filtering ("Show Annotated" vs "Not Annotated").
18+
* **Navigation:** Implements logic to jump between text events (`_navigate_annotation`).
19+
20+
21+
22+
### `dense_file_manager.py`
23+
24+
**The I/O Handler.**
25+
Manages the serialization and deserialization of the Dense JSON format.
26+
27+
* **Key Responsibilities:**
28+
* **Strict Validation:** calls `AppState.validate_dense_json` before loading to prevent corruption.
29+
* **Metadata Preservation:** Ensures Global Metadata (Dataset info) and Item-level Metadata are preserved during a Load -> Save cycle.
30+
* **Path Resolution:** Converts absolute paths to relative paths upon Export for portability.
31+
* **Data Structure:** Maps the flat JSON `dense_captions` list to the internal dictionary format:
32+
```json
33+
"dense_captions": [
34+
{ "position_ms": 12500, "lang": "en", "text": "A player kicks the ball." }
35+
]
36+
37+
```

0 commit comments

Comments
 (0)