lazylabel-gui 1.1.5__py3-none-any.whl → 1.1.7__py3-none-any.whl
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/__main__.py +6 -0
- lazylabel/config/settings.py +72 -65
- lazylabel/core/file_manager.py +123 -122
- lazylabel/core/model_manager.py +96 -95
- lazylabel/main.py +39 -37
- lazylabel/models/sam_model.py +211 -200
- lazylabel/ui/control_panel.py +283 -245
- lazylabel/ui/hotkey_dialog.py +417 -416
- lazylabel/ui/main_window.py +2020 -1882
- lazylabel/ui/photo_viewer.py +55 -1
- lazylabel/ui/widgets/adjustments_widget.py +372 -108
- lazylabel/ui/widgets/settings_widget.py +125 -113
- lazylabel/utils/logger.py +45 -0
- lazylabel_gui-1.1.7.dist-info/METADATA +240 -0
- {lazylabel_gui-1.1.5.dist-info → lazylabel_gui-1.1.7.dist-info}/RECORD +19 -17
- lazylabel_gui-1.1.5.dist-info/METADATA +0 -243
- {lazylabel_gui-1.1.5.dist-info → lazylabel_gui-1.1.7.dist-info}/WHEEL +0 -0
- {lazylabel_gui-1.1.5.dist-info → lazylabel_gui-1.1.7.dist-info}/entry_points.txt +0 -0
- {lazylabel_gui-1.1.5.dist-info → lazylabel_gui-1.1.7.dist-info}/licenses/LICENSE +0 -0
- {lazylabel_gui-1.1.5.dist-info → lazylabel_gui-1.1.7.dist-info}/top_level.txt +0 -0
@@ -1,243 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: lazylabel-gui
|
3
|
-
Version: 1.1.5
|
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
|
-

|
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)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|