Skip to content

Commit 492443a

Browse files
Update README.md
1 parent ce1327b commit 492443a

1 file changed

Lines changed: 44 additions & 25 deletions

File tree

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,60 @@
11
# 🏷️ Classification UI Module
22

3-
This directory contains the user interface components specifically designed for the **Whole-Video Classification** task.
3+
This directory contains the user interface components specifically designed for the **Whole-Video Classification** task. In this mode, users assign attributes (labels) to an entire video clip rather than specific timestamps.
4+
5+
The UI is deeply integrated with the new AI workflow, offering dynamic schema-driven manual annotation, AI smart predictions, and in-app model training.
6+
7+
## 📂 Directory Structure
8+
9+
```text
10+
ui/classification/
11+
├── panels.py # High-level 3-column layout container
12+
├── media_player/ # Center area components
13+
│ ├── __init__.py # Assembles the ClassificationMediaPlayer
14+
│ ├── player_panel.py # Combines the Shared VideoSurface with Slider controls
15+
│ └── controls.py # Playback & Navigation buttons (Next/Prev Clip)
16+
├── event_editor/ # Right sidebar components
17+
│ ├── __init__.py # Assembles the ClassificationEventEditor
18+
│ ├── editor.py # Tabbed Command Center & Native Donut Chart
19+
│ └── dynamic_widgets.py # Dynamically generated Radio/Checkbox schema groups
20+
└── __init__.py
21+
```
422

5-
In this mode, users assign attributes (labels) to an entire video clip rather than specific timestamps. The UI is designed to dynamically adapt to the project's JSON schema.
23+
---
24+
25+
## 📝 Module Breakdown
626

7-
## 📂 File Descriptions
27+
### 1. `panels.py`
28+
**Purpose:** High-Level Layout Orchestration.
829

9-
### `panels.py`
30+
Defines the `ClassificationUI` class, acting as the main skeleton for the workspace. It utilizes a three-column horizontal layout to mount the core functional areas:
31+
* **Left:** Shared `ClipListPanel` (imported from `ui.common` for tree navigation).
32+
* **Center:** `ClassificationMediaPlayer` (from `media_player`).
33+
* **Right:** `ClassificationEventEditor` (from `event_editor`).
1034

11-
This file defines the structural containers for the classification interface. It arranges the screen into three distinct areas:
35+
### 2. `media_player/` (Center Area)
36+
**Purpose:** Video Playback and Clip Navigation.
1237

13-
* **`LeftPanel`**:
14-
* Hosts the **Project Controls** (imported from `ui/common`).
15-
* Displays the **Action Clip List** (File Tree).
16-
* Manages filtering options (All / Done / Not Done).
17-
* **`CenterPanel`**:
18-
* Contains the video player (`VideoViewAndControl`).
19-
* Hosts navigation buttons (Previous/Next Action, Previous/Next Clip).
20-
* **`RightPanel`**:
21-
* **Dynamic Form Area**: Automatically generates input fields based on the project Schema.
22-
* **Manual Annotation Box**: Displays the current selection state and confirmation buttons.
38+
This module replaces the legacy player with a robust, unified media pipeline to eliminate playback artifacts.
2339

24-
### `widgets.py`
25-
**Task-Specific Components**
40+
* **`player_panel.py`**: Contains the `PlayerPanel`. This widget marries the unified, shared `VideoSurface` with a custom `ClickableSlider` and time labels. It exposes the underlying `QMediaPlayer` so the controller logic can safely orchestrate loading and playing without UI freezes.
41+
* **`controls.py`**: Contains the `PlaybackControlBar`. Unlike Localization, which requires granular frame stepping, Classification provides high-level dataset navigation (e.g., `<< Prev Action`, `Next Clip >`).
2642

27-
This file contains specialized widgets that are mostly generated programmatically based on the user's label definitions:
43+
### 3. `event_editor/` (Right Sidebar)
44+
**Purpose:** Data Entry, Schema Management, and AI Workflows.
2845

29-
* **`DynamicSingleLabelGroup`**: A `QGroupBox` containing **Radio Buttons**. Used when the schema defines a "single_label" type (Mutually exclusive).
30-
* **`DynamicMultiLabelGroup`**: A `QGroupBox` containing **Checkboxes**. Used when the schema defines a "multi_label" type (Multiple selections allowed).
31-
* **`VideoViewAndControl`**: A wrapper widget combining `QVideoWidget`, a custom clickable seek slider, and time labels specific to the classification workflow.
46+
This module has been massively expanded from a simple manual entry form into a **Tabbed Command Center** handling three distinct workflows:
3247

33-
### `__init__.py`
34-
* Exposes the classes from `panels` and `widgets` to the rest of the application, simplifying import statements.
48+
* **Tab 1: Hand Annotation (`dynamic_widgets.py`)**:
49+
* Features a schema-driven UI. Instead of hardcoding categories, it reads the JSON schema and dynamically instantiates `DynamicSingleLabelGroup` (Radio Buttons) or `DynamicMultiLabelGroup` (Checkboxes).
50+
* **Tab 2: Smart Annotation (`editor.py`)**:
51+
* Hosts the AI inference interface. Includes Single/Batch inference controls and features a highly optimized, custom `NativeDonutChart` (built with `QPainter`) to interactively visualize model confidence scores.
52+
* **Tab 3: Train (`editor.py`)**:
53+
* A dedicated UI for fine-tuning models. Collects hyperparameters (Epochs, LR, Device) and provides a real-time console terminal to monitor the background training loop.
3554

3655
---
3756

3857
## 💡 Key Concepts
3958

40-
1. **Dynamic UI Generation**: The **RightPanel** does not have hardcoded buttons for labels (e.g., "Goal", "Foul"). Instead, it reads the `label_definitions` from the Model and instantiates the appropriate `Dynamic...LabelGroup` widgets from `widgets.py` at runtime.
41-
2. **Shared Controls**: The **LeftPanel** embeds the `UnifiedProjectControls` from the `../common/` directory to ensure the "Save/Load/Export" experience is consistent with the Localization mode.
59+
1. **Dynamic UI Generation**: The **Right Panel** adapts instantly to the dataset. If a user adds a new Category via the text input, the UI automatically constructs and mounts the corresponding radio/checkbox group.
60+
2. **Tab-Aware Logic**: The bottom action buttons ("Confirm" and "Clear") dynamically alter their signals depending on whether the user is viewing the Hand Annotation tab or the Smart Annotation tab, ensuring manual and AI states remain isolated until confirmed.

0 commit comments

Comments
 (0)