Skip to content

Commit 3195721

Browse files
Update README.md
1 parent 2c505ed commit 3195721

1 file changed

Lines changed: 15 additions & 55 deletions

File tree

annotation_tool/ui/localization/README.md

Lines changed: 15 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,23 @@
22

33
This directory contains the user interface components specifically designed for the **Action Spotting (Localization)** task. In this mode, users identify specific timestamps (events) within a video timeline, rather than categorizing the whole video.
44

5-
<img width="2076" height="1094" alt="localization" src="https://github.com/user-attachments/assets/9220ed90-db63-410c-b277-422131a2a6bb" />
5+
The layout architecture relies on the **Unified Workspace** pattern, where specialized components defined here are injected into a common application skeleton.
66

7+
<img width="2076" height="1094" alt="localization" src="https://github.com/user-attachments/assets/9220ed90-db63-410c-b277-422131a2a6bb" />
78

89
## 📂 Directory Structure
910

10-
```text
11-
localization/
12-
├── panels.py # High-level layout container for the Localization view
13-
├── widgets/ # Specialized functional components
14-
│ ├── clip_explorer.py # Left sidebar: Video list & project controls
15-
│ ├── media_player.py # Center area: Video player & timeline
16-
│ └── event_editor.py # Right sidebar: Event buttons & data table
17-
└── __init__.py
18-
19-
```
20-
21-
---
22-
23-
## 📝 File Descriptions
24-
25-
### 1. `panels.py`
26-
27-
**Purpose:** Layout Management.
28-
This file defines the `LocalizationUI` class, which acts as the main container. It uses a `QHBoxLayout` (Horizontal Box Layout) to assemble the three main working areas:
29-
30-
* **Left:** Clip Explorer
31-
* **Center:** Media Player
32-
* **Right:** Event Editor
33-
34-
It serves as the integration point where these distinct widgets are instantiated and arranged.
35-
36-
### 2. `widgets/clip_explorer.py` (Left Sidebar)
37-
38-
**Purpose:** Resource Navigation & Project Management.
39-
40-
* **Clip Tree:** Displays the list of video files available in the project. It handles filtering (e.g., showing only "Done" or "Not Done" clips) and visual status indicators (checkmarks).
41-
* **Project Controls:** Integrates the shared `UnifiedProjectControls` (from `ui/common`), providing standard buttons for saving, loading, and exporting the project.
42-
43-
### 3. `widgets/media_player.py` (Center Area)
44-
45-
**Purpose:** Video Playback & Visualization.
46-
47-
* **`MediaPreviewWidget`**: A wrapper around `QVideoWidget` for displaying the video content.
48-
* **`TimelineWidget`**: A custom-painted widget that represents the video duration horizontally. It supports:
49-
* **Visual Markers**: Draws red lines where events have been spotted.
50-
* **Zooming**: Allows expanding the timeline for precise frame selection.
51-
* **Auto-scrolling**: Keeps the playhead in view during playback.
52-
53-
54-
* **`PlaybackControlBar`**: Provides granular control, including frame stepping (`<< 1s`, `>> 1s`), variable playback speed (0.25x - 4.0x), and seeking.
55-
56-
### 4. `widgets/event_editor.py` (Right Sidebar)
57-
58-
**Purpose:** Data Entry & Modification.
59-
60-
* **`AnnotationManagementWidget`**: A tabbed interface allowing users to organize annotations by categories (Headers). Inside each tab, dynamic buttons allow users to "spot" an action at the current timestamp.
61-
* **`AnnotationTableWidget`**: A table view listing all recorded events for the current video. It supports:
62-
* **In-place Editing**: Users can double-click cells to modify timestamps or labels.
63-
* **Selection Sync**: Clicking a row jumps the video player to that event's time.
11+
The structure has been modularized into packages to separate concerns (Playback vs. Data Entry).
6412

13+
```text
14+
ui/localization/
15+
├── media_player/ # [Package] Center Panel: Playback & Timeline logic
16+
│ ├── __init__.py # Assembles and exports LocCenterPanel
17+
│ ├── preview.py # Video surface (QVideoWidget wrapper)
18+
│ ├── timeline.py # Custom painted timeline, zooming, and slider logic
19+
│ └── controls.py # Playback buttons (Play, Pause, Speed, Seek)
20+
21+
└── event_editor/ # [Package] Right Panel: Data entry & Modification
22+
├── __init__.py # Assembles and exports LocRightPanel
23+
├── spotting_controls.py# Tabbed interface for creating new events (Spotting)
24+
└── annotation_table.py # Table view for listing and editing existing events

0 commit comments

Comments
 (0)