lazylabel-gui 1.1.5__tar.gz → 1.1.7__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.
- lazylabel_gui-1.1.7/PKG-INFO +240 -0
- lazylabel_gui-1.1.7/README.md +185 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/pyproject.toml +1 -1
- lazylabel_gui-1.1.7/src/lazylabel/__main__.py +6 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/config/settings.py +72 -65
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/core/file_manager.py +123 -122
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/core/model_manager.py +96 -95
- lazylabel_gui-1.1.7/src/lazylabel/main.py +39 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/models/sam_model.py +211 -200
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/control_panel.py +283 -245
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/hotkey_dialog.py +417 -416
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/main_window.py +2020 -1882
- lazylabel_gui-1.1.7/src/lazylabel/ui/photo_viewer.py +105 -0
- lazylabel_gui-1.1.7/src/lazylabel/ui/widgets/adjustments_widget.py +372 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/widgets/settings_widget.py +125 -113
- lazylabel_gui-1.1.7/src/lazylabel/utils/logger.py +45 -0
- lazylabel_gui-1.1.7/src/lazylabel_gui.egg-info/PKG-INFO +240 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel_gui.egg-info/SOURCES.txt +2 -0
- lazylabel_gui-1.1.5/PKG-INFO +0 -243
- lazylabel_gui-1.1.5/README.md +0 -188
- lazylabel_gui-1.1.5/src/lazylabel/main.py +0 -37
- lazylabel_gui-1.1.5/src/lazylabel/ui/photo_viewer.py +0 -51
- lazylabel_gui-1.1.5/src/lazylabel/ui/widgets/adjustments_widget.py +0 -108
- lazylabel_gui-1.1.5/src/lazylabel_gui.egg-info/PKG-INFO +0 -243
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/LICENSE +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/setup.cfg +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/__init__.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/config/__init__.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/config/hotkeys.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/config/paths.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/core/__init__.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/core/segment_manager.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/models/__init__.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/__init__.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/editable_vertex.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/hoverable_pixelmap_item.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/hoverable_polygon_item.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/numeric_table_widget_item.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/reorderable_class_table.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/right_panel.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/widgets/__init__.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/widgets/model_selection_widget.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/ui/widgets/status_bar.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/utils/__init__.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/utils/custom_file_system_model.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel/utils/utils.py +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel_gui.egg-info/dependency_links.txt +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel_gui.egg-info/entry_points.txt +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel_gui.egg-info/requires.txt +0 -0
- {lazylabel_gui-1.1.5 → lazylabel_gui-1.1.7}/src/lazylabel_gui.egg-info/top_level.txt +0 -0
@@ -0,0 +1,240 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: lazylabel-gui
|
3
|
+
Version: 1.1.7
|
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
|
+
**AI-Assisted Image Segmentation Made Simple**
|
59
|
+
|
60
|
+
LazyLabel combines Meta's Segment Anything Model (SAM) with intuitive editing tools for fast, precise image labeling. Perfect for machine learning datasets, computer vision research, and annotation workflows.
|
61
|
+
|
62
|
+

|
63
|
+
|
64
|
+
---
|
65
|
+
|
66
|
+
## 🚀 Quick Start
|
67
|
+
|
68
|
+
### Installation
|
69
|
+
```bash
|
70
|
+
pip install lazylabel-gui
|
71
|
+
lazylabel-gui
|
72
|
+
```
|
73
|
+
|
74
|
+
### Usage
|
75
|
+
1. **Open Folder** → Select your image directory
|
76
|
+
2. **Click on image** → AI generates instant masks
|
77
|
+
3. **Fine-tune** → Edit polygons, merge segments, adjust classes
|
78
|
+
4. **Export** → Clean `.npz` files ready for ML training
|
79
|
+
|
80
|
+
---
|
81
|
+
|
82
|
+
## ✨ Key Features
|
83
|
+
|
84
|
+
### **🧠 AI-Powered Segmentation**
|
85
|
+
- **One-click masking** with Meta's SAM model
|
86
|
+
- **Smart prompting** via positive/negative points
|
87
|
+
- **Fragment filtering** to remove small artifacts
|
88
|
+
- **Multiple model support** (VIT-H, VIT-L, VIT-B)
|
89
|
+
|
90
|
+
### **🎨 Advanced Editing**
|
91
|
+
- **Polygon drawing** with full vertex control
|
92
|
+
- **Bounding box** annotation mode
|
93
|
+
- **Shape merging** and class assignment
|
94
|
+
- **Edit mode** for precision adjustments
|
95
|
+
|
96
|
+
### **⚡ Productivity Tools**
|
97
|
+
- **Image adjustments** (brightness, contrast, gamma)
|
98
|
+
- **Customizable hotkeys** for all functions
|
99
|
+
- **Undo/redo** with full history
|
100
|
+
- **Auto-save** and session persistence
|
101
|
+
|
102
|
+
### **📊 ML-Ready Outputs**
|
103
|
+
- **One-hot encoded** `.npz` format
|
104
|
+
- **Clean class separation** with shape `(H, W, Classes)`
|
105
|
+
- **Batch processing** support
|
106
|
+
- **Existing mask loading** for iterative work
|
107
|
+
|
108
|
+
---
|
109
|
+
|
110
|
+
## ⌨️ Essential Controls
|
111
|
+
|
112
|
+
| Mode | Key | Action |
|
113
|
+
|------|-----|--------|
|
114
|
+
| **AI Segmentation** | `1` | Point mode for SAM |
|
115
|
+
| | `Left Click` | Add positive point |
|
116
|
+
| | `Right Click` | Add negative point |
|
117
|
+
| | `Space` | Save segment |
|
118
|
+
| **Manual Drawing** | `2` | Polygon mode |
|
119
|
+
| | `Left Click` | Add vertex |
|
120
|
+
| | `Enter` | Close polygon |
|
121
|
+
| **Editing** | `E` | Selection mode |
|
122
|
+
| | `R` | Edit selected shapes |
|
123
|
+
| | `M` | Merge selected segments |
|
124
|
+
| **Navigation** | `Q` | Pan mode |
|
125
|
+
| | `W/A/S/D` | Pan image |
|
126
|
+
| | `Scroll` | Zoom in/out |
|
127
|
+
|
128
|
+
**💡 All hotkeys are customizable** - Click "Hotkeys" button to personalize shortcuts
|
129
|
+
|
130
|
+
---
|
131
|
+
|
132
|
+
## 📦 Output Format
|
133
|
+
|
134
|
+
LazyLabel exports clean, ML-ready data:
|
135
|
+
|
136
|
+
```python
|
137
|
+
import numpy as np
|
138
|
+
|
139
|
+
# Load your labeled data
|
140
|
+
data = np.load('your_image.npz')
|
141
|
+
mask = data['mask'] # Shape: (height, width, num_classes)
|
142
|
+
|
143
|
+
# Each channel is a binary mask for one class
|
144
|
+
class_0_mask = mask[:, :, 0] # Binary mask for class 0
|
145
|
+
class_1_mask = mask[:, :, 1] # Binary mask for class 1
|
146
|
+
# ... and so on
|
147
|
+
```
|
148
|
+
|
149
|
+
**Perfect for:**
|
150
|
+
- Semantic segmentation training
|
151
|
+
- Instance segmentation datasets
|
152
|
+
- Computer vision research
|
153
|
+
- Automated annotation pipelines
|
154
|
+
|
155
|
+
---
|
156
|
+
|
157
|
+
## 🛠️ Advanced Features
|
158
|
+
|
159
|
+
### **Image Enhancement**
|
160
|
+
- **Brightness/Contrast** adjustment sliders
|
161
|
+
- **Gamma correction** for better visibility
|
162
|
+
- **Live preview** of adjustments
|
163
|
+
- **SAM integration** with adjusted images
|
164
|
+
|
165
|
+
### **Smart Filtering**
|
166
|
+
- **Fragment threshold** removes small segments
|
167
|
+
- **Size-based filtering** (0-100% of largest segment)
|
168
|
+
- **Quality control** for clean annotations
|
169
|
+
|
170
|
+
### **Professional Workflow**
|
171
|
+
- **Class management** with custom aliases
|
172
|
+
- **Segment organization** with sortable tables
|
173
|
+
- **Batch export** for large datasets
|
174
|
+
- **Model switching** without restart
|
175
|
+
|
176
|
+
---
|
177
|
+
|
178
|
+
## 🏗️ Development
|
179
|
+
|
180
|
+
### Installation from Source
|
181
|
+
```bash
|
182
|
+
git clone https://github.com/dnzckn/LazyLabel.git
|
183
|
+
cd LazyLabel
|
184
|
+
pip install -e .
|
185
|
+
lazylabel-gui
|
186
|
+
```
|
187
|
+
|
188
|
+
### Code Quality & Testing
|
189
|
+
```bash
|
190
|
+
# Linting & formatting
|
191
|
+
ruff check . && ruff format .
|
192
|
+
|
193
|
+
# Run tests with coverage
|
194
|
+
python -m pytest --cov=lazylabel --cov-report=html
|
195
|
+
|
196
|
+
# All tests pass with 60%+ coverage
|
197
|
+
```
|
198
|
+
|
199
|
+
### Architecture
|
200
|
+
- **Modular design** with clean separation of concerns
|
201
|
+
- **Signal-based communication** between components
|
202
|
+
- **Extensible model system** for new SAM variants
|
203
|
+
- **Comprehensive test suite** with 95% speed optimization
|
204
|
+
|
205
|
+
---
|
206
|
+
|
207
|
+
## 📋 Requirements
|
208
|
+
|
209
|
+
- **Python 3.10+**
|
210
|
+
- **OpenCV** for image processing
|
211
|
+
- **PyQt6** for GUI
|
212
|
+
- **NumPy** for data handling
|
213
|
+
- **2.5GB** disk space for SAM model (auto-downloaded)
|
214
|
+
|
215
|
+
---
|
216
|
+
|
217
|
+
## 🤝 Contributing
|
218
|
+
|
219
|
+
LazyLabel welcomes contributions! Check out our:
|
220
|
+
- [Architecture Guide](src/lazylabel/ARCHITECTURE.md) for technical details
|
221
|
+
- [Hotkey System](src/lazylabel/HOTKEY_FEATURE.md) for customization
|
222
|
+
- Issues page for feature requests and bug reports
|
223
|
+
|
224
|
+
---
|
225
|
+
|
226
|
+
## 🙏 Acknowledgments
|
227
|
+
|
228
|
+
LazyLabel was inspired by and builds upon the excellent work of:
|
229
|
+
- [LabelMe](https://github.com/wkentaro/labelme) - The pioneering open-source image annotation tool
|
230
|
+
- [Segment-Anything-UI](https://github.com/branislavhesko/segment-anything-ui) - Early SAM integration concepts
|
231
|
+
|
232
|
+
---
|
233
|
+
|
234
|
+
## ☕ Support
|
235
|
+
|
236
|
+
If LazyLabel saves you time on annotation tasks, [consider supporting the project!](https://buymeacoffee.com/dnzckn)
|
237
|
+
|
238
|
+
---
|
239
|
+
|
240
|
+
**Made with ❤️ for the computer vision community**
|
@@ -0,0 +1,185 @@
|
|
1
|
+
# <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;" />
|
2
|
+
|
3
|
+
**AI-Assisted Image Segmentation Made Simple**
|
4
|
+
|
5
|
+
LazyLabel combines Meta's Segment Anything Model (SAM) with intuitive editing tools for fast, precise image labeling. Perfect for machine learning datasets, computer vision research, and annotation workflows.
|
6
|
+
|
7
|
+

|
8
|
+
|
9
|
+
---
|
10
|
+
|
11
|
+
## 🚀 Quick Start
|
12
|
+
|
13
|
+
### Installation
|
14
|
+
```bash
|
15
|
+
pip install lazylabel-gui
|
16
|
+
lazylabel-gui
|
17
|
+
```
|
18
|
+
|
19
|
+
### Usage
|
20
|
+
1. **Open Folder** → Select your image directory
|
21
|
+
2. **Click on image** → AI generates instant masks
|
22
|
+
3. **Fine-tune** → Edit polygons, merge segments, adjust classes
|
23
|
+
4. **Export** → Clean `.npz` files ready for ML training
|
24
|
+
|
25
|
+
---
|
26
|
+
|
27
|
+
## ✨ Key Features
|
28
|
+
|
29
|
+
### **🧠 AI-Powered Segmentation**
|
30
|
+
- **One-click masking** with Meta's SAM model
|
31
|
+
- **Smart prompting** via positive/negative points
|
32
|
+
- **Fragment filtering** to remove small artifacts
|
33
|
+
- **Multiple model support** (VIT-H, VIT-L, VIT-B)
|
34
|
+
|
35
|
+
### **🎨 Advanced Editing**
|
36
|
+
- **Polygon drawing** with full vertex control
|
37
|
+
- **Bounding box** annotation mode
|
38
|
+
- **Shape merging** and class assignment
|
39
|
+
- **Edit mode** for precision adjustments
|
40
|
+
|
41
|
+
### **⚡ Productivity Tools**
|
42
|
+
- **Image adjustments** (brightness, contrast, gamma)
|
43
|
+
- **Customizable hotkeys** for all functions
|
44
|
+
- **Undo/redo** with full history
|
45
|
+
- **Auto-save** and session persistence
|
46
|
+
|
47
|
+
### **📊 ML-Ready Outputs**
|
48
|
+
- **One-hot encoded** `.npz` format
|
49
|
+
- **Clean class separation** with shape `(H, W, Classes)`
|
50
|
+
- **Batch processing** support
|
51
|
+
- **Existing mask loading** for iterative work
|
52
|
+
|
53
|
+
---
|
54
|
+
|
55
|
+
## ⌨️ Essential Controls
|
56
|
+
|
57
|
+
| Mode | Key | Action |
|
58
|
+
|------|-----|--------|
|
59
|
+
| **AI Segmentation** | `1` | Point mode for SAM |
|
60
|
+
| | `Left Click` | Add positive point |
|
61
|
+
| | `Right Click` | Add negative point |
|
62
|
+
| | `Space` | Save segment |
|
63
|
+
| **Manual Drawing** | `2` | Polygon mode |
|
64
|
+
| | `Left Click` | Add vertex |
|
65
|
+
| | `Enter` | Close polygon |
|
66
|
+
| **Editing** | `E` | Selection mode |
|
67
|
+
| | `R` | Edit selected shapes |
|
68
|
+
| | `M` | Merge selected segments |
|
69
|
+
| **Navigation** | `Q` | Pan mode |
|
70
|
+
| | `W/A/S/D` | Pan image |
|
71
|
+
| | `Scroll` | Zoom in/out |
|
72
|
+
|
73
|
+
**💡 All hotkeys are customizable** - Click "Hotkeys" button to personalize shortcuts
|
74
|
+
|
75
|
+
---
|
76
|
+
|
77
|
+
## 📦 Output Format
|
78
|
+
|
79
|
+
LazyLabel exports clean, ML-ready data:
|
80
|
+
|
81
|
+
```python
|
82
|
+
import numpy as np
|
83
|
+
|
84
|
+
# Load your labeled data
|
85
|
+
data = np.load('your_image.npz')
|
86
|
+
mask = data['mask'] # Shape: (height, width, num_classes)
|
87
|
+
|
88
|
+
# Each channel is a binary mask for one class
|
89
|
+
class_0_mask = mask[:, :, 0] # Binary mask for class 0
|
90
|
+
class_1_mask = mask[:, :, 1] # Binary mask for class 1
|
91
|
+
# ... and so on
|
92
|
+
```
|
93
|
+
|
94
|
+
**Perfect for:**
|
95
|
+
- Semantic segmentation training
|
96
|
+
- Instance segmentation datasets
|
97
|
+
- Computer vision research
|
98
|
+
- Automated annotation pipelines
|
99
|
+
|
100
|
+
---
|
101
|
+
|
102
|
+
## 🛠️ Advanced Features
|
103
|
+
|
104
|
+
### **Image Enhancement**
|
105
|
+
- **Brightness/Contrast** adjustment sliders
|
106
|
+
- **Gamma correction** for better visibility
|
107
|
+
- **Live preview** of adjustments
|
108
|
+
- **SAM integration** with adjusted images
|
109
|
+
|
110
|
+
### **Smart Filtering**
|
111
|
+
- **Fragment threshold** removes small segments
|
112
|
+
- **Size-based filtering** (0-100% of largest segment)
|
113
|
+
- **Quality control** for clean annotations
|
114
|
+
|
115
|
+
### **Professional Workflow**
|
116
|
+
- **Class management** with custom aliases
|
117
|
+
- **Segment organization** with sortable tables
|
118
|
+
- **Batch export** for large datasets
|
119
|
+
- **Model switching** without restart
|
120
|
+
|
121
|
+
---
|
122
|
+
|
123
|
+
## 🏗️ Development
|
124
|
+
|
125
|
+
### Installation from Source
|
126
|
+
```bash
|
127
|
+
git clone https://github.com/dnzckn/LazyLabel.git
|
128
|
+
cd LazyLabel
|
129
|
+
pip install -e .
|
130
|
+
lazylabel-gui
|
131
|
+
```
|
132
|
+
|
133
|
+
### Code Quality & Testing
|
134
|
+
```bash
|
135
|
+
# Linting & formatting
|
136
|
+
ruff check . && ruff format .
|
137
|
+
|
138
|
+
# Run tests with coverage
|
139
|
+
python -m pytest --cov=lazylabel --cov-report=html
|
140
|
+
|
141
|
+
# All tests pass with 60%+ coverage
|
142
|
+
```
|
143
|
+
|
144
|
+
### Architecture
|
145
|
+
- **Modular design** with clean separation of concerns
|
146
|
+
- **Signal-based communication** between components
|
147
|
+
- **Extensible model system** for new SAM variants
|
148
|
+
- **Comprehensive test suite** with 95% speed optimization
|
149
|
+
|
150
|
+
---
|
151
|
+
|
152
|
+
## 📋 Requirements
|
153
|
+
|
154
|
+
- **Python 3.10+**
|
155
|
+
- **OpenCV** for image processing
|
156
|
+
- **PyQt6** for GUI
|
157
|
+
- **NumPy** for data handling
|
158
|
+
- **2.5GB** disk space for SAM model (auto-downloaded)
|
159
|
+
|
160
|
+
---
|
161
|
+
|
162
|
+
## 🤝 Contributing
|
163
|
+
|
164
|
+
LazyLabel welcomes contributions! Check out our:
|
165
|
+
- [Architecture Guide](src/lazylabel/ARCHITECTURE.md) for technical details
|
166
|
+
- [Hotkey System](src/lazylabel/HOTKEY_FEATURE.md) for customization
|
167
|
+
- Issues page for feature requests and bug reports
|
168
|
+
|
169
|
+
---
|
170
|
+
|
171
|
+
## 🙏 Acknowledgments
|
172
|
+
|
173
|
+
LazyLabel was inspired by and builds upon the excellent work of:
|
174
|
+
- [LabelMe](https://github.com/wkentaro/labelme) - The pioneering open-source image annotation tool
|
175
|
+
- [Segment-Anything-UI](https://github.com/branislavhesko/segment-anything-ui) - Early SAM integration concepts
|
176
|
+
|
177
|
+
---
|
178
|
+
|
179
|
+
## ☕ Support
|
180
|
+
|
181
|
+
If LazyLabel saves you time on annotation tasks, [consider supporting the project!](https://buymeacoffee.com/dnzckn)
|
182
|
+
|
183
|
+
---
|
184
|
+
|
185
|
+
**Made with ❤️ for the computer vision community**
|
@@ -1,65 +1,72 @@
|
|
1
|
-
"""Application settings and configuration."""
|
2
|
-
|
3
|
-
import json
|
4
|
-
import os
|
5
|
-
from dataclasses import asdict, dataclass
|
6
|
-
|
7
|
-
|
8
|
-
@dataclass
|
9
|
-
class Settings:
|
10
|
-
"""Application settings with defaults."""
|
11
|
-
|
12
|
-
# UI Settings
|
13
|
-
window_width: int = 1600
|
14
|
-
window_height: int = 900
|
15
|
-
left_panel_width: int = 250
|
16
|
-
right_panel_width: int = 350
|
17
|
-
|
18
|
-
# Annotation Settings
|
19
|
-
point_radius: float = 0.3
|
20
|
-
line_thickness: float = 0.5
|
21
|
-
pan_multiplier: float = 1.0
|
22
|
-
polygon_join_threshold: int = 2
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
#
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
def
|
46
|
-
"""
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
return cls()
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
1
|
+
"""Application settings and configuration."""
|
2
|
+
|
3
|
+
import json
|
4
|
+
import os
|
5
|
+
from dataclasses import asdict, dataclass
|
6
|
+
|
7
|
+
|
8
|
+
@dataclass
|
9
|
+
class Settings:
|
10
|
+
"""Application settings with defaults."""
|
11
|
+
|
12
|
+
# UI Settings
|
13
|
+
window_width: int = 1600
|
14
|
+
window_height: int = 900
|
15
|
+
left_panel_width: int = 250
|
16
|
+
right_panel_width: int = 350
|
17
|
+
|
18
|
+
# Annotation Settings
|
19
|
+
point_radius: float = 0.3
|
20
|
+
line_thickness: float = 0.5
|
21
|
+
pan_multiplier: float = 1.0
|
22
|
+
polygon_join_threshold: int = 2
|
23
|
+
fragment_threshold: int = 0
|
24
|
+
|
25
|
+
# Image Adjustment Settings
|
26
|
+
brightness: float = 0.0
|
27
|
+
contrast: float = 0.0
|
28
|
+
gamma: float = 1.0
|
29
|
+
|
30
|
+
# Model Settings
|
31
|
+
default_model_type: str = "vit_h"
|
32
|
+
default_model_filename: str = "sam_vit_h_4b8939.pth"
|
33
|
+
operate_on_view: bool = False
|
34
|
+
|
35
|
+
# Save Settings
|
36
|
+
auto_save: bool = True
|
37
|
+
save_npz: bool = True
|
38
|
+
save_txt: bool = True
|
39
|
+
save_class_aliases: bool = False
|
40
|
+
yolo_use_alias: bool = True
|
41
|
+
|
42
|
+
# UI State
|
43
|
+
annotation_size_multiplier: float = 1.0
|
44
|
+
|
45
|
+
def save_to_file(self, filepath: str) -> None:
|
46
|
+
"""Save settings to JSON file."""
|
47
|
+
os.makedirs(os.path.dirname(filepath), exist_ok=True)
|
48
|
+
with open(filepath, "w") as f:
|
49
|
+
json.dump(asdict(self), f, indent=4)
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def load_from_file(cls, filepath: str) -> "Settings":
|
53
|
+
"""Load settings from JSON file."""
|
54
|
+
if not os.path.exists(filepath):
|
55
|
+
return cls()
|
56
|
+
|
57
|
+
try:
|
58
|
+
with open(filepath) as f:
|
59
|
+
data = json.load(f)
|
60
|
+
return cls(**data)
|
61
|
+
except (json.JSONDecodeError, TypeError):
|
62
|
+
return cls()
|
63
|
+
|
64
|
+
def update(self, **kwargs) -> None:
|
65
|
+
"""Update settings with new values."""
|
66
|
+
for key, value in kwargs.items():
|
67
|
+
if hasattr(self, key):
|
68
|
+
setattr(self, key, value)
|
69
|
+
|
70
|
+
|
71
|
+
# Default settings instance
|
72
|
+
DEFAULT_SETTINGS = Settings()
|