lazylabel-gui 1.1.2__tar.gz → 1.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/LICENSE +21 -21
  2. {lazylabel_gui-1.1.2/src/lazylabel_gui.egg-info → lazylabel_gui-1.1.4}/PKG-INFO +243 -197
  3. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/README.md +188 -148
  4. lazylabel_gui-1.1.4/pyproject.toml +93 -0
  5. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/setup.cfg +4 -4
  6. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/__init__.py +9 -9
  7. lazylabel_gui-1.1.4/src/lazylabel/config/__init__.py +7 -0
  8. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/config/hotkeys.py +96 -57
  9. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/config/paths.py +40 -41
  10. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/config/settings.py +65 -66
  11. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/core/__init__.py +7 -7
  12. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/core/file_manager.py +122 -106
  13. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/core/model_manager.py +95 -97
  14. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/core/segment_manager.py +183 -171
  15. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/main.py +37 -36
  16. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/models/__init__.py +5 -5
  17. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/models/sam_model.py +200 -195
  18. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/__init__.py +8 -8
  19. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/control_panel.py +245 -241
  20. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/editable_vertex.py +64 -64
  21. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/hotkey_dialog.py +416 -384
  22. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/hoverable_pixelmap_item.py +22 -22
  23. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/hoverable_polygon_item.py +38 -39
  24. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/main_window.py +1860 -1659
  25. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/numeric_table_widget_item.py +9 -9
  26. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/photo_viewer.py +51 -54
  27. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/reorderable_class_table.py +60 -61
  28. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/right_panel.py +332 -315
  29. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/widgets/__init__.py +8 -8
  30. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/widgets/adjustments_widget.py +108 -108
  31. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/widgets/model_selection_widget.py +101 -94
  32. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/widgets/settings_widget.py +113 -106
  33. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/ui/widgets/status_bar.py +109 -109
  34. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/utils/__init__.py +6 -6
  35. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/utils/custom_file_system_model.py +133 -132
  36. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel/utils/utils.py +12 -12
  37. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4/src/lazylabel_gui.egg-info}/PKG-INFO +243 -197
  38. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel_gui.egg-info/requires.txt +7 -0
  39. lazylabel_gui-1.1.2/pyproject.toml +0 -40
  40. lazylabel_gui-1.1.2/src/lazylabel/config/__init__.py +0 -7
  41. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel_gui.egg-info/SOURCES.txt +0 -0
  42. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel_gui.egg-info/dependency_links.txt +0 -0
  43. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel_gui.egg-info/entry_points.txt +0 -0
  44. {lazylabel_gui-1.1.2 → lazylabel_gui-1.1.4}/src/lazylabel_gui.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Deniz N. Cakan
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Deniz N. Cakan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,197 +1,243 @@
1
- Metadata-Version: 2.4
2
- Name: lazylabel-gui
3
- Version: 1.1.2
4
- Summary: An image segmentation GUI for generating ML ready mask tensors and annotations.
5
- Author-email: "Deniz N. Cakan" <deniz.n.cakan@gmail.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 Deniz N. Cakan
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://github.com/dnzckn/lazylabel
29
- Project-URL: Bug Tracker, https://github.com/dnzckn/lazylabel/issues
30
- Classifier: Programming Language :: Python :: 3
31
- Classifier: License :: OSI Approved :: MIT License
32
- Classifier: Operating System :: OS Independent
33
- Classifier: Topic :: Scientific/Engineering :: Image Processing
34
- Classifier: Environment :: X11 Applications :: Qt
35
- Requires-Python: >=3.10
36
- Description-Content-Type: text/markdown
37
- License-File: LICENSE
38
- Requires-Dist: PyQt6>=6.9.0
39
- Requires-Dist: pyqtdarktheme==2.1.0
40
- Requires-Dist: torch>=2.7.1
41
- Requires-Dist: torchvision>=0.22.1
42
- Requires-Dist: segment-anything==1.0
43
- Requires-Dist: numpy>=2.1.2
44
- Requires-Dist: opencv-python>=4.11.0.86
45
- Requires-Dist: scipy>=1.15.3
46
- Requires-Dist: requests>=2.32.4
47
- Requires-Dist: tqdm>=4.67.1
48
- Dynamic: license-file
49
-
50
- # <img src="https://raw.githubusercontent.com/dnzckn/LazyLabel/main/src/lazylabel/demo_pictures/logo2.png" alt="LazyLabel Logo" style="height:60px; vertical-align:middle;" /> <img src="https://raw.githubusercontent.com/dnzckn/LazyLabel/main/src/lazylabel/demo_pictures/logo_black.png" alt="LazyLabel Cursive" style="height:60px; vertical-align:middle;" />
51
-
52
- LazyLabel is an intuitive, AI-assisted image segmentation tool built with a modern, modular architecture. It uses Meta's Segment Anything Model (SAM) for quick, precise mask generation, alongside advanced polygon editing for fine-tuned control. Features comprehensive model management, customizable hotkeys, and outputs in clean, one-hot encoded `.npz` format for easy machine learning integration.
53
-
54
- Inspired by [LabelMe](https://github.com/wkentaro/labelme?tab=readme-ov-file#installation) and [Segment-Anything-UI](https://github.com/branislavhesko/segment-anything-ui/tree/main).
55
-
56
- ![LazyLabel Screenshot](https://raw.githubusercontent.com/dnzckn/LazyLabel/main/src/lazylabel/demo_pictures/gui.PNG)
57
-
58
- ---
59
-
60
- ## Core Features
61
-
62
- ### **AI-Powered Segmentation**
63
- * Generate masks with simple left-click (positive) and right-click (negative) interactions
64
- * Multiple SAM model support with easy switching
65
- * Custom model loading from any directory
66
-
67
- ### **Advanced Editing Tools**
68
- * **Vector Polygon Tool**: Full control to draw, edit, and reshape polygons
69
- * **Vertex Editing**: Drag vertices or move entire shapes with precision
70
- * **Selection & Merging**: Select, merge, and re-order segments intuitively
71
-
72
- ### **Professional Workflow**
73
- * **Customizable Hotkeys**: Personalize keyboard shortcuts for all functions
74
- * **Advanced Class Management**: Assign multiple segments to single class IDs
75
- * **Smart I/O**: Load existing `.npz` masks; save as clean, one-hot encoded outputs
76
- * **Interactive UI**: Color-coded segments, sortable lists, and hover highlighting
77
-
78
- ### **Modern Architecture**
79
- * **Modular Design**: Clean, maintainable codebase with separated concerns
80
- * **Model Management**: Dedicated model storage and switching system
81
- * **Persistent Settings**: User preferences saved between sessions
82
-
83
- ---
84
-
85
- ## 🚀 Getting Started
86
-
87
- ### Prerequisites
88
- **Python 3.10+**
89
-
90
- ### Installation
91
-
92
- #### For Users [via PyPI](https://pypi.org/project/lazylabel-gui/)
93
- 1. Install LazyLabel directly:
94
- ```bash
95
- pip install lazylabel-gui
96
- ```
97
- 2. Run the application:
98
- ```bash
99
- lazylabel-gui
100
- ```
101
-
102
- #### For Developers (from Source)
103
- 1. Clone the repository:
104
- ```bash
105
- git clone https://github.com/dnzckn/LazyLabel.git
106
- cd LazyLabel
107
- ```
108
- 2. Install in editable mode:
109
- ```bash
110
- pip install -e .
111
- ```
112
- 3. Run the application:
113
- ```bash
114
- lazylabel-gui
115
- ```
116
-
117
- ### Model Management
118
- * **Default Storage**: Models are stored in `src/lazylabel/models/` directory
119
- * **Custom Models**: Click "Browse Models" to select custom model folders
120
- * **Model Switching**: Use the dropdown to switch between available models
121
- * **Auto-Detection**: Application automatically detects all `.pth` files in selected directories
122
-
123
- **Note**: On the first run, the application will automatically download the SAM model checkpoint (~2.5 GB) from Meta's repository to the models directory. This is a one-time download.
124
-
125
- ---
126
-
127
- ## ⌨️ Controls & Keybinds
128
-
129
- > **💡 Tip**: All hotkeys are fully customizable! Click the "Hotkeys" button in the control panel to personalize your shortcuts.
130
-
131
- ### Modes
132
- | Key | Action |
133
- |---|---|
134
- | `1` | Enter **Point Mode** (for AI segmentation). |
135
- | `2` | Enter **Polygon Drawing Mode**. |
136
- | `E` | Toggle **Selection Mode** to select existing segments. |
137
- | `R` | Enter **Edit Mode** for selected polygons (drag shape or vertices). |
138
- | `Q` | Toggle **Pan Mode** (click and drag the image). |
139
-
140
- ### Actions
141
- | Key(s) | Action |
142
- |---|---|
143
- | `L-Click` | Add positive point (Point Mode) or polygon vertex. |
144
- | `R-Click` | Add negative point (Point Mode). |
145
- | `Ctrl + Z` | Undo last point. |
146
- | `Spacebar` | Finalize and save current AI segment. |
147
- | `Enter` | **Save final mask for the current image to a `.npz` file.** |
148
- | `M` | **Merge** selected segments into a single class. |
149
- | `V` / `Delete` / `Backspace`| **Delete** selected segments. |
150
- | `C` | Clear temporary points/vertices. |
151
- | `W/A/S/D` | Pan image. |
152
- | `Scroll Wheel` | Zoom-in or -out. |
153
-
154
- ---
155
-
156
- ## 📦 Output Format
157
-
158
- LazyLabel saves your work as a compressed NumPy array (`.npz`) with the same name as your image file.
159
-
160
- The file contains a single data key, `'mask'`, holding a **one-hot encoded tensor** with the shape `(H, W, C)`:
161
- * `H`: Image height.
162
- * `W`: Image width.
163
- * `C`: Total unique classes.
164
-
165
- Each channel is a binary mask for a class, combining all assigned segments into a clean, ML-ready output.
166
-
167
- ---
168
-
169
- ## 🏗️ Architecture
170
-
171
- LazyLabel features a modern, modular architecture designed for maintainability and extensibility:
172
-
173
- * **Modular Design**: Clean separation between UI, business logic, and configuration
174
- * **Signal-Based Communication**: Loose coupling between components using PyQt signals
175
- * **Persistent Configuration**: User settings and preferences saved between sessions
176
- * **Extensible Model System**: Easy integration of new SAM models and types
177
-
178
- For detailed technical documentation, see [ARCHITECTURE.md](src/lazylabel/ARCHITECTURE.md).
179
-
180
- ---
181
-
182
- ## ⌨️ Hotkey Customization
183
-
184
- LazyLabel includes a comprehensive hotkey management system:
185
-
186
- * **Full Customization**: Personalize keyboard shortcuts for all 27+ functions
187
- * **Category Organization**: Hotkeys organized by function (Modes, Actions, Navigation, etc.)
188
- * **Primary & Secondary Keys**: Set multiple shortcuts for the same action
189
- * **Persistent Settings**: Custom hotkeys saved between sessions
190
- * **Conflict Prevention**: System prevents duplicate key assignments
191
-
192
- For complete hotkey documentation, see [HOTKEY_FEATURE.md](src/lazylabel/HOTKEY_FEATURE.md).
193
-
194
- ---
195
-
196
- ## Support LazyLabel
197
- [If you found LazyLabel helpful, consider supporting the project!](https://buymeacoffee.com/dnzckn)
1
+ Metadata-Version: 2.4
2
+ Name: lazylabel-gui
3
+ Version: 1.1.4
4
+ Summary: An image segmentation GUI for generating ML ready mask tensors and annotations.
5
+ Author-email: "Deniz N. Cakan" <deniz.n.cakan@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Deniz N. Cakan
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/dnzckn/lazylabel
29
+ Project-URL: Bug Tracker, https://github.com/dnzckn/lazylabel/issues
30
+ Classifier: Programming Language :: Python :: 3
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Operating System :: OS Independent
33
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
34
+ Classifier: Environment :: X11 Applications :: Qt
35
+ Requires-Python: >=3.10
36
+ Description-Content-Type: text/markdown
37
+ License-File: LICENSE
38
+ Requires-Dist: PyQt6>=6.9.0
39
+ Requires-Dist: pyqtdarktheme==2.1.0
40
+ Requires-Dist: torch>=2.7.1
41
+ Requires-Dist: torchvision>=0.22.1
42
+ Requires-Dist: segment-anything==1.0
43
+ Requires-Dist: numpy>=2.1.2
44
+ Requires-Dist: opencv-python>=4.11.0.86
45
+ Requires-Dist: scipy>=1.15.3
46
+ Requires-Dist: requests>=2.32.4
47
+ Requires-Dist: tqdm>=4.67.1
48
+ Provides-Extra: dev
49
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
50
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
51
+ Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
52
+ Requires-Dist: pytest-qt>=4.2.0; extra == "dev"
53
+ Requires-Dist: ruff>=0.8.0; extra == "dev"
54
+ Dynamic: license-file
55
+
56
+ # <img src="https://raw.githubusercontent.com/dnzckn/LazyLabel/main/src/lazylabel/demo_pictures/logo2.png" alt="LazyLabel Logo" style="height:60px; vertical-align:middle;" /> <img src="https://raw.githubusercontent.com/dnzckn/LazyLabel/main/src/lazylabel/demo_pictures/logo_black.png" alt="LazyLabel Cursive" style="height:60px; vertical-align:middle;" />
57
+
58
+ LazyLabel is an intuitive, AI-assisted image segmentation tool built with a modern, modular architecture. It uses Meta's Segment Anything Model (SAM) for quick, precise mask generation, alongside advanced polygon editing for fine-tuned control. Features comprehensive model management, customizable hotkeys, and outputs in clean, one-hot encoded `.npz` format for easy machine learning integration.
59
+
60
+ Inspired by [LabelMe](https://github.com/wkentaro/labelme?tab=readme-ov-file#installation) and [Segment-Anything-UI](https://github.com/branislavhesko/segment-anything-ui/tree/main).
61
+
62
+ ![LazyLabel Screenshot](https://raw.githubusercontent.com/dnzckn/LazyLabel/main/src/lazylabel/demo_pictures/gui.PNG)
63
+
64
+ ---
65
+
66
+ ## ✨ Core Features
67
+
68
+ ### **AI-Powered Segmentation**
69
+ * Generate masks with simple left-click (positive) and right-click (negative) interactions
70
+ * Multiple SAM model support with easy switching
71
+ * Custom model loading from any directory
72
+
73
+ ### **Advanced Editing Tools**
74
+ * **Vector Polygon Tool**: Full control to draw, edit, and reshape polygons
75
+ * **Vertex Editing**: Drag vertices or move entire shapes with precision
76
+ * **Selection & Merging**: Select, merge, and re-order segments intuitively
77
+
78
+ ### **Professional Workflow**
79
+ * **Customizable Hotkeys**: Personalize keyboard shortcuts for all functions
80
+ * **Advanced Class Management**: Assign multiple segments to single class IDs
81
+ * **Smart I/O**: Load existing `.npz` masks; save as clean, one-hot encoded outputs
82
+ * **Interactive UI**: Color-coded segments, sortable lists, and hover highlighting
83
+
84
+ ### **Modern Architecture**
85
+ * **Modular Design**: Clean, maintainable codebase with separated concerns
86
+ * **Model Management**: Dedicated model storage and switching system
87
+ * **Persistent Settings**: User preferences saved between sessions
88
+
89
+ ---
90
+
91
+ ## 🚀 Getting Started
92
+
93
+ ### Prerequisites
94
+ **Python 3.10+**
95
+
96
+ ### Installation
97
+
98
+ #### For Users [via PyPI](https://pypi.org/project/lazylabel-gui/)
99
+ 1. Install LazyLabel directly:
100
+ ```bash
101
+ pip install lazylabel-gui
102
+ ```
103
+ 2. Run the application:
104
+ ```bash
105
+ lazylabel-gui
106
+ ```
107
+
108
+ #### For Developers (from Source)
109
+ 1. Clone the repository:
110
+ ```bash
111
+ git clone https://github.com/dnzckn/LazyLabel.git
112
+ cd LazyLabel
113
+ ```
114
+ 2. Install in editable mode:
115
+ ```bash
116
+ pip install -e .
117
+ ```
118
+ 3. Run the application:
119
+ ```bash
120
+ lazylabel-gui
121
+ ```
122
+
123
+ ### Model Management
124
+ * **Default Storage**: Models are stored in `src/lazylabel/models/` directory
125
+ * **Custom Models**: Click "Browse Models" to select custom model folders
126
+ * **Model Switching**: Use the dropdown to switch between available models
127
+ * **Auto-Detection**: Application automatically detects all `.pth` files in selected directories
128
+
129
+ **Note**: On the first run, the application will automatically download the SAM model checkpoint (~2.5 GB) from Meta's repository to the models directory. This is a one-time download.
130
+
131
+ ---
132
+
133
+ ## ⌨️ Controls & Keybinds
134
+
135
+ > **💡 Tip**: All hotkeys are fully customizable! Click the "Hotkeys" button in the control panel to personalize your shortcuts.
136
+
137
+ ### Modes
138
+ | Key | Action |
139
+ |---|---|
140
+ | `1` | Enter **Point Mode** (for AI segmentation). |
141
+ | `2` | Enter **Polygon Drawing Mode**. |
142
+ | `E` | Toggle **Selection Mode** to select existing segments. |
143
+ | `R` | Enter **Edit Mode** for selected polygons (drag shape or vertices). |
144
+ | `Q` | Toggle **Pan Mode** (click and drag the image). |
145
+
146
+ ### Actions
147
+ | Key(s) | Action |
148
+ |---|---|
149
+ | `L-Click` | Add positive point (Point Mode) or polygon vertex. |
150
+ | `R-Click` | Add negative point (Point Mode). |
151
+ | `Ctrl + Z` | Undo last action. |
152
+ | `Ctrl + Y` / `Ctrl + Shift + Z` | Redo last action. |
153
+ | `Spacebar` | Finalize and save current AI segment. |
154
+ | `Enter` | **Save final mask for the current image to a `.npz` file.** |
155
+ | `M` | **Merge** selected segments into a single class. |
156
+ | `V` / `Delete` / `Backspace`| **Delete** selected segments. |
157
+ | `C` | Clear temporary points/vertices. |
158
+ | `W/A/S/D` | Pan image. |
159
+ | `Scroll Wheel` | Zoom-in or -out. |
160
+
161
+ ---
162
+
163
+ ## 📦 Output Format
164
+
165
+ LazyLabel saves your work as a compressed NumPy array (`.npz`) with the same name as your image file.
166
+
167
+ The file contains a single data key, `'mask'`, holding a **one-hot encoded tensor** with the shape `(H, W, C)`:
168
+ * `H`: Image height.
169
+ * `W`: Image width.
170
+ * `C`: Total unique classes.
171
+
172
+ Each channel is a binary mask for a class, combining all assigned segments into a clean, ML-ready output.
173
+
174
+ ---
175
+
176
+ ## 🏗️ Architecture
177
+
178
+ LazyLabel features a modern, modular architecture designed for maintainability and extensibility:
179
+
180
+ * **Modular Design**: Clean separation between UI, business logic, and configuration
181
+ * **Signal-Based Communication**: Loose coupling between components using PyQt signals
182
+ * **Persistent Configuration**: User settings and preferences saved between sessions
183
+ * **Extensible Model System**: Easy integration of new SAM models and types
184
+
185
+ For detailed technical documentation, see [ARCHITECTURE.md](src/lazylabel/ARCHITECTURE.md).
186
+
187
+ ---
188
+
189
+ ## ⌨️ Hotkey Customization
190
+
191
+ LazyLabel includes a comprehensive hotkey management system:
192
+
193
+ * **Full Customization**: Personalize keyboard shortcuts for all 27+ functions
194
+ * **Category Organization**: Hotkeys organized by function (Modes, Actions, Navigation, etc.)
195
+ * **Primary & Secondary Keys**: Set multiple shortcuts for the same action
196
+ * **Persistent Settings**: Custom hotkeys saved between sessions
197
+ * **Conflict Prevention**: System prevents duplicate key assignments
198
+
199
+ For complete hotkey documentation, see [HOTKEY_FEATURE.md](src/lazylabel/HOTKEY_FEATURE.md).
200
+
201
+ ## Development
202
+
203
+ ### Code Quality
204
+ This project uses Ruff for linting and formatting:
205
+
206
+ ```bash
207
+ # Activate virtual environment first
208
+ & e:\venv\lazylabel\Scripts\Activate.ps1
209
+
210
+ # Run linter
211
+ ruff check .
212
+
213
+ # Fix auto-fixable issues
214
+ ruff check --fix .
215
+
216
+ # Format code
217
+ ruff format .
218
+
219
+ # Check if code is properly formatted
220
+ ruff format --check .
221
+ ```
222
+
223
+ ### Testing
224
+
225
+ Run tests using pytest:
226
+
227
+ ```bash
228
+ # Run all tests
229
+ python -m pytest
230
+
231
+ # Run tests with coverage
232
+ python -m pytest --cov=lazylabel --cov-report=html --cov-report=term-missing
233
+
234
+ # Run specific test file
235
+ python -m pytest tests/unit/ui/test_undo_redo.py -v
236
+ ```
237
+
238
+ The HTML coverage report will be generated in `htmlcov/` directory.
239
+
240
+ ---
241
+
242
+ ## ☕ Support LazyLabel
243
+ [If you found LazyLabel helpful, consider supporting the project!](https://buymeacoffee.com/dnzckn)