lazylabel-gui 1.0.6__py3-none-any.whl → 1.0.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/controls.py +59 -4
- lazylabel/custom_file_system_model.py +10 -4
- lazylabel/editable_vertex.py +7 -3
- lazylabel/hoverable_pixelmap_item.py +22 -0
- lazylabel/main.py +492 -96
- lazylabel/photo_viewer.py +6 -3
- lazylabel/reorderable_class_table.py +10 -7
- lazylabel/utils.py +2 -2
- {lazylabel_gui-1.0.6.dist-info → lazylabel_gui-1.0.7.dist-info}/METADATA +2 -2
- lazylabel_gui-1.0.7.dist-info/RECORD +17 -0
- lazylabel_gui-1.0.6.dist-info/RECORD +0 -16
- {lazylabel_gui-1.0.6.dist-info → lazylabel_gui-1.0.7.dist-info}/WHEEL +0 -0
- {lazylabel_gui-1.0.6.dist-info → lazylabel_gui-1.0.7.dist-info}/entry_points.txt +0 -0
- {lazylabel_gui-1.0.6.dist-info → lazylabel_gui-1.0.7.dist-info}/licenses/LICENSE +0 -0
- {lazylabel_gui-1.0.6.dist-info → lazylabel_gui-1.0.7.dist-info}/top_level.txt +0 -0
lazylabel/photo_viewer.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
from PyQt6.QtCore import Qt, QRectF
|
2
|
-
from PyQt6.QtGui import QPixmap
|
2
|
+
from PyQt6.QtGui import QPixmap, QCursor
|
3
3
|
from PyQt6.QtWidgets import QGraphicsView, QGraphicsScene, QGraphicsPixmapItem
|
4
4
|
|
5
5
|
|
@@ -21,8 +21,7 @@ class PhotoViewer(QGraphicsView):
|
|
21
21
|
rect = QRectF(self._pixmap_item.pixmap().rect())
|
22
22
|
if not rect.isNull():
|
23
23
|
self.setSceneRect(rect)
|
24
|
-
|
25
|
-
self.scale(1 / unity.width(), 1 / unity.height())
|
24
|
+
self.resetTransform()
|
26
25
|
viewrect = self.viewport().rect()
|
27
26
|
scenerect = self.transform().mapRect(rect)
|
28
27
|
factor = min(
|
@@ -30,6 +29,7 @@ class PhotoViewer(QGraphicsView):
|
|
30
29
|
viewrect.height() / scenerect.height(),
|
31
30
|
)
|
32
31
|
self.scale(factor, factor)
|
32
|
+
self.centerOn(self._pixmap_item)
|
33
33
|
|
34
34
|
def set_photo(self, pixmap):
|
35
35
|
if pixmap and not pixmap.isNull():
|
@@ -38,6 +38,9 @@ class PhotoViewer(QGraphicsView):
|
|
38
38
|
else:
|
39
39
|
self._pixmap_item.setPixmap(QPixmap())
|
40
40
|
|
41
|
+
def set_cursor(self, cursor_shape):
|
42
|
+
self.viewport().setCursor(QCursor(cursor_shape))
|
43
|
+
|
41
44
|
def resizeEvent(self, event):
|
42
45
|
self.fitInView()
|
43
46
|
super().resizeEvent(event)
|
@@ -34,11 +34,13 @@ class ReorderableClassTable(QTableWidget):
|
|
34
34
|
list({index.row() for index in self.selectedIndexes()}), reverse=True
|
35
35
|
)
|
36
36
|
|
37
|
-
|
37
|
+
dragged_rows_data = []
|
38
38
|
for row in selected_rows:
|
39
|
-
# Take
|
40
|
-
|
41
|
-
|
39
|
+
# Take all items from the row
|
40
|
+
row_data = [
|
41
|
+
self.takeItem(row, col) for col in range(self.columnCount())
|
42
|
+
]
|
43
|
+
dragged_rows_data.insert(0, row_data)
|
42
44
|
# Then remove the row itself
|
43
45
|
self.removeRow(row)
|
44
46
|
|
@@ -47,10 +49,11 @@ class ReorderableClassTable(QTableWidget):
|
|
47
49
|
if row < drop_row:
|
48
50
|
drop_row -= 1
|
49
51
|
|
50
|
-
# Insert items at the new location
|
51
|
-
for
|
52
|
+
# Insert rows and their items at the new location
|
53
|
+
for row_data in dragged_rows_data:
|
52
54
|
self.insertRow(drop_row)
|
53
|
-
|
55
|
+
for col, item in enumerate(row_data):
|
56
|
+
self.setItem(drop_row, col, item)
|
54
57
|
self.selectRow(drop_row)
|
55
58
|
drop_row += 1
|
56
59
|
|
lazylabel/utils.py
CHANGED
@@ -2,10 +2,10 @@ import numpy as np
|
|
2
2
|
from PyQt6.QtGui import QImage, QPixmap
|
3
3
|
|
4
4
|
|
5
|
-
def mask_to_pixmap(mask, color):
|
5
|
+
def mask_to_pixmap(mask, color, alpha=150):
|
6
6
|
colored_mask = np.zeros((mask.shape[0], mask.shape[1], 4), dtype=np.uint8)
|
7
7
|
colored_mask[mask, :3] = color
|
8
|
-
colored_mask[mask, 3] =
|
8
|
+
colored_mask[mask, 3] = alpha # Alpha channel for transparency
|
9
9
|
image = QImage(
|
10
10
|
colored_mask.data, mask.shape[1], mask.shape[0], QImage.Format.Format_RGBA8888
|
11
11
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: lazylabel-gui
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.7
|
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
|
@@ -48,7 +48,7 @@ Requires-Dist: tqdm>=4.67.1
|
|
48
48
|
Dynamic: license-file
|
49
49
|
|
50
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
|
-
LazyLabel is an intuitive, AI-assisted image segmentation tool. It uses Meta's Segment Anything Model (SAM) for quick, precise mask generation, alongside advanced polygon editing for fine-tuned control. Outputs are saved in a clean, one-hot encoded format for easy machine learning integration.
|
51
|
+
LazyLabel is an intuitive, AI-assisted image segmentation tool. It uses Meta's Segment Anything Model (SAM) for quick, precise mask generation, alongside advanced polygon editing for fine-tuned control. Outputs are saved in a clean, one-hot encoded `.npz` format for easy machine learning integration and in YOLO `.txt` format.
|
52
52
|
|
53
53
|
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).
|
54
54
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
lazylabel/controls.py,sha256=WfI0aIO1nfJ7YGTsEyP5Oc6Cd5A1Tbar943eaE_-KEY,6312
|
2
|
+
lazylabel/custom_file_system_model.py,sha256=YSM1CN5bza7Q2Cjb4unXgvc-SbYwvhUQNS1_G7ncofk,2302
|
3
|
+
lazylabel/editable_vertex.py,sha256=itGcZG5MyuctGfxjINu8IJBYFFsCGuE_YtsrfHICjiw,1115
|
4
|
+
lazylabel/hoverable_pixelmap_item.py,sha256=kJFOp7WXiyHpNf7l73TZjiob85jgP30b5MZvu_z5L3c,728
|
5
|
+
lazylabel/hoverable_polygon_item.py,sha256=-0l8C8PfsXtJGqvZZ2qtizxHmFwO8RCwz5UfjKpDvzY,775
|
6
|
+
lazylabel/main.py,sha256=TPpPIv74IetnwQbQh8pUtUey74KO3rISFXPBLJSlrtM,46445
|
7
|
+
lazylabel/numeric_table_widget_item.py,sha256=ZnwaUvCeOGEX504DfbLHWKMKVMt5zSjdQkPjPCuYCcY,346
|
8
|
+
lazylabel/photo_viewer.py,sha256=PNgm0gU2gnIqvRkrGlQugdobGsKwAi3m3X6ZF487lCo,2055
|
9
|
+
lazylabel/reorderable_class_table.py,sha256=4c-iuSkPcmk5Aey5n2zz49O85x9TQPujKG-JLxtuBCo,2406
|
10
|
+
lazylabel/sam_model.py,sha256=9NB51Xq1P5dIxZMBdttwwRlszlJR3U5HRs83QsPLxNE,2595
|
11
|
+
lazylabel/utils.py,sha256=3NfzgxTgYoevv82owmcGzLqrIBdE_B4DlWgumVf4y_E,448
|
12
|
+
lazylabel_gui-1.0.7.dist-info/licenses/LICENSE,sha256=kSDEIgrWAPd1u2UFGGpC9X71dhzrlzBFs8hbDlENnGE,1092
|
13
|
+
lazylabel_gui-1.0.7.dist-info/METADATA,sha256=MskYLxZx4sccjcAcf2RWH_4LLPho4Xz0w8W8f8z7iU4,6292
|
14
|
+
lazylabel_gui-1.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
15
|
+
lazylabel_gui-1.0.7.dist-info/entry_points.txt,sha256=Hd0WwEG9OPTa_ziYjiD0aRh7R6Fupt-wdQ3sspdc1mM,54
|
16
|
+
lazylabel_gui-1.0.7.dist-info/top_level.txt,sha256=YN4uIyrpDBq1wiJaBuZLDipIzyZY0jqJOmmXiPIOUkU,10
|
17
|
+
lazylabel_gui-1.0.7.dist-info/RECORD,,
|
@@ -1,16 +0,0 @@
|
|
1
|
-
lazylabel/controls.py,sha256=YCTm8hQMgk4GFrr7b8p5p8PX3IQi9NoWZV1EFYEhDI8,4125
|
2
|
-
lazylabel/custom_file_system_model.py,sha256=c1cxQqrfZ7d0Tz9kHpygiIEqw4ffuEBjkD8wjumNaSY,2005
|
3
|
-
lazylabel/editable_vertex.py,sha256=lw_MmDmgkiPZbouIb6DkqIEJZhG32AJ2T2TUt0P3rWk,1040
|
4
|
-
lazylabel/hoverable_polygon_item.py,sha256=-0l8C8PfsXtJGqvZZ2qtizxHmFwO8RCwz5UfjKpDvzY,775
|
5
|
-
lazylabel/main.py,sha256=EUTmxS2AiJ7BEYkKIkCfhn2rraxZHX00kQ98eMTnxy0,35234
|
6
|
-
lazylabel/numeric_table_widget_item.py,sha256=ZnwaUvCeOGEX504DfbLHWKMKVMt5zSjdQkPjPCuYCcY,346
|
7
|
-
lazylabel/photo_viewer.py,sha256=qZ6t9RO0TOXQuoLr6ASVy6sgSIcVFPwyNRnjkK5MIHc,1993
|
8
|
-
lazylabel/reorderable_class_table.py,sha256=9BctudGTrb6dTV8_7IpQ5lMM0D-5unuQbLVk3Yu49xQ,2242
|
9
|
-
lazylabel/sam_model.py,sha256=9NB51Xq1P5dIxZMBdttwwRlszlJR3U5HRs83QsPLxNE,2595
|
10
|
-
lazylabel/utils.py,sha256=a2n2f4NehzSjS8-UwbOioYTSO_lWe1uYjzDdOIEJloE,435
|
11
|
-
lazylabel_gui-1.0.6.dist-info/licenses/LICENSE,sha256=kSDEIgrWAPd1u2UFGGpC9X71dhzrlzBFs8hbDlENnGE,1092
|
12
|
-
lazylabel_gui-1.0.6.dist-info/METADATA,sha256=uHTTXfYNtNuazxOxyWIdBwt9TRM0B4htdfH8LhgGyd4,6259
|
13
|
-
lazylabel_gui-1.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
-
lazylabel_gui-1.0.6.dist-info/entry_points.txt,sha256=Hd0WwEG9OPTa_ziYjiD0aRh7R6Fupt-wdQ3sspdc1mM,54
|
15
|
-
lazylabel_gui-1.0.6.dist-info/top_level.txt,sha256=YN4uIyrpDBq1wiJaBuZLDipIzyZY0jqJOmmXiPIOUkU,10
|
16
|
-
lazylabel_gui-1.0.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|