lazylabel-gui 1.0.2__py3-none-any.whl → 1.0.3__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 +11 -4
- {lazylabel_gui-1.0.2.dist-info → lazylabel_gui-1.0.3.dist-info}/METADATA +4 -4
- {lazylabel_gui-1.0.2.dist-info → lazylabel_gui-1.0.3.dist-info}/RECORD +7 -7
- {lazylabel_gui-1.0.2.dist-info → lazylabel_gui-1.0.3.dist-info}/WHEEL +0 -0
- {lazylabel_gui-1.0.2.dist-info → lazylabel_gui-1.0.3.dist-info}/entry_points.txt +0 -0
- {lazylabel_gui-1.0.2.dist-info → lazylabel_gui-1.0.3.dist-info}/licenses/LICENSE +0 -0
- {lazylabel_gui-1.0.2.dist-info → lazylabel_gui-1.0.3.dist-info}/top_level.txt +0 -0
lazylabel/main.py
CHANGED
@@ -19,7 +19,6 @@ from PyQt6.QtWidgets import (
|
|
19
19
|
from PyQt6.QtGui import QPixmap, QColor, QPen, QBrush, QPolygonF, QIcon
|
20
20
|
from PyQt6.QtCore import Qt, QPointF, QTimer
|
21
21
|
|
22
|
-
# Relative imports for package structure
|
23
22
|
from .photo_viewer import PhotoViewer
|
24
23
|
from .sam_model import SamModel
|
25
24
|
from .utils import mask_to_pixmap
|
@@ -43,7 +42,6 @@ class MainWindow(QMainWindow):
|
|
43
42
|
|
44
43
|
self.setGeometry(50, 50, 1600, 900)
|
45
44
|
|
46
|
-
# The SamModel instance is now passed in
|
47
45
|
self.sam_model = sam_model
|
48
46
|
self.mode = "sam_points"
|
49
47
|
self.previous_mode = "sam_points"
|
@@ -118,10 +116,16 @@ class MainWindow(QMainWindow):
|
|
118
116
|
self.control_panel.btn_clear_points.clicked.connect(self.clear_all_points)
|
119
117
|
|
120
118
|
def set_mode(self, mode_name, is_toggle=False):
|
119
|
+
# Clear selection if exiting selection mode
|
120
|
+
if self.mode == "selection" and mode_name != "selection":
|
121
|
+
self.right_panel.segment_table.clearSelection()
|
122
|
+
|
121
123
|
if self.mode == "edit" and mode_name != "edit":
|
122
124
|
self.display_all_segments()
|
125
|
+
|
123
126
|
if not is_toggle and self.mode not in ["pan", "selection", "edit"]:
|
124
127
|
self.previous_mode = self.mode
|
128
|
+
|
125
129
|
self.mode = mode_name
|
126
130
|
self.control_panel.mode_label.setText(
|
127
131
|
f"Mode: {mode_name.replace('_', ' ').title()}"
|
@@ -179,7 +183,9 @@ class MainWindow(QMainWindow):
|
|
179
183
|
self.current_file_index = index
|
180
184
|
path = self.file_model.filePath(index)
|
181
185
|
|
182
|
-
if os.path.isfile(path) and path.lower().endswith(
|
186
|
+
if os.path.isfile(path) and path.lower().endswith(
|
187
|
+
(".png", ".jpg", ".jpeg", ".tiff")
|
188
|
+
):
|
183
189
|
self.current_image_path = path
|
184
190
|
pixmap = QPixmap(self.current_image_path)
|
185
191
|
if not pixmap.isNull():
|
@@ -429,6 +435,7 @@ class MainWindow(QMainWindow):
|
|
429
435
|
for i, seg_dict in enumerate(self.segments):
|
430
436
|
self.segment_items[i] = []
|
431
437
|
class_id = seg_dict.get("class_id", 0)
|
438
|
+
|
432
439
|
hue_index = class_id_to_hue_index.get(class_id, 0)
|
433
440
|
hue = int((hue_index * 360 / num_classes)) % 360
|
434
441
|
base_color = QColor.fromHsv(hue, 220, 220)
|
@@ -854,7 +861,7 @@ class MainWindow(QMainWindow):
|
|
854
861
|
def main():
|
855
862
|
app = QApplication(sys.argv)
|
856
863
|
qdarktheme.setup_theme()
|
857
|
-
sam_model = SamModel(model_type="vit_h")
|
864
|
+
sam_model = SamModel(model_type="vit_h")
|
858
865
|
main_win = MainWindow(sam_model)
|
859
866
|
main_win.show()
|
860
867
|
sys.exit(app.exec())
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: lazylabel-gui
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.3
|
4
4
|
Summary: An image segmentation GUI for generating mask tensors.
|
5
5
|
Author-email: "Deniz N. Cakan" <deniz.n.cakan@gmail.com>
|
6
6
|
License: MIT License
|
@@ -70,11 +70,11 @@ Inspired by [LabelMe](https://github.com/wkentaro/labelme?tab=readme-ov-file#ins
|
|
70
70
|
## 🚀 Getting Started
|
71
71
|
|
72
72
|
### Prerequisites
|
73
|
-
|
73
|
+
**Python 3.10**
|
74
74
|
|
75
75
|
### Installation
|
76
76
|
|
77
|
-
#### For Users
|
77
|
+
#### For Users [via PyPI](https://pypi.org/project/lazylabel-gui/)
|
78
78
|
1. Install LazyLabel directly:
|
79
79
|
```bash
|
80
80
|
pip install lazylabel-gui
|
@@ -87,7 +87,7 @@ Ensure you have **Python 3.10** or newer.
|
|
87
87
|
#### For Developers (from Source)
|
88
88
|
1. Clone the repository:
|
89
89
|
```bash
|
90
|
-
git clone
|
90
|
+
git clone https://github.com/dnzckn/LazyLabel.git
|
91
91
|
cd LazyLabel
|
92
92
|
```
|
93
93
|
2. Install in editable mode, which links the installed package to your source directory:
|
@@ -2,15 +2,15 @@ lazylabel/controls.py,sha256=YCTm8hQMgk4GFrr7b8p5p8PX3IQi9NoWZV1EFYEhDI8,4125
|
|
2
2
|
lazylabel/custom_file_system_model.py,sha256=QwqlHKrvBZbpKLXhUdBbJMbdImp7j6MnI8JCs7yKOlw,1996
|
3
3
|
lazylabel/editable_vertex.py,sha256=lw_MmDmgkiPZbouIb6DkqIEJZhG32AJ2T2TUt0P3rWk,1040
|
4
4
|
lazylabel/hoverable_polygon_item.py,sha256=-0l8C8PfsXtJGqvZZ2qtizxHmFwO8RCwz5UfjKpDvzY,775
|
5
|
-
lazylabel/main.py,sha256=
|
5
|
+
lazylabel/main.py,sha256=jFt8Ln-l2pdrXcgz-iuB6vuDfrkgwq1VF97NnDLVf6Y,35337
|
6
6
|
lazylabel/numeric_table_widget_item.py,sha256=ZnwaUvCeOGEX504DfbLHWKMKVMt5zSjdQkPjPCuYCcY,346
|
7
7
|
lazylabel/photo_viewer.py,sha256=qZ6t9RO0TOXQuoLr6ASVy6sgSIcVFPwyNRnjkK5MIHc,1993
|
8
8
|
lazylabel/reorderable_class_table.py,sha256=9BctudGTrb6dTV8_7IpQ5lMM0D-5unuQbLVk3Yu49xQ,2242
|
9
9
|
lazylabel/sam_model.py,sha256=9NB51Xq1P5dIxZMBdttwwRlszlJR3U5HRs83QsPLxNE,2595
|
10
10
|
lazylabel/utils.py,sha256=a2n2f4NehzSjS8-UwbOioYTSO_lWe1uYjzDdOIEJloE,435
|
11
|
-
lazylabel_gui-1.0.
|
12
|
-
lazylabel_gui-1.0.
|
13
|
-
lazylabel_gui-1.0.
|
14
|
-
lazylabel_gui-1.0.
|
15
|
-
lazylabel_gui-1.0.
|
16
|
-
lazylabel_gui-1.0.
|
11
|
+
lazylabel_gui-1.0.3.dist-info/licenses/LICENSE,sha256=kSDEIgrWAPd1u2UFGGpC9X71dhzrlzBFs8hbDlENnGE,1092
|
12
|
+
lazylabel_gui-1.0.3.dist-info/METADATA,sha256=PNqWmfgbgnWqOZLDbfg4nXlqQiKqwwCt_bRf5d9F_vI,6259
|
13
|
+
lazylabel_gui-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
+
lazylabel_gui-1.0.3.dist-info/entry_points.txt,sha256=Hd0WwEG9OPTa_ziYjiD0aRh7R6Fupt-wdQ3sspdc1mM,54
|
15
|
+
lazylabel_gui-1.0.3.dist-info/top_level.txt,sha256=YN4uIyrpDBq1wiJaBuZLDipIzyZY0jqJOmmXiPIOUkU,10
|
16
|
+
lazylabel_gui-1.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|