lazylabel-gui 1.2.1__py3-none-any.whl → 1.3.1__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/config/settings.py +3 -0
- lazylabel/main.py +1 -0
- lazylabel/models/sam2_model.py +166 -18
- lazylabel/ui/control_panel.py +17 -15
- lazylabel/ui/editable_vertex.py +72 -0
- lazylabel/ui/hoverable_pixelmap_item.py +25 -0
- lazylabel/ui/hoverable_polygon_item.py +26 -0
- lazylabel/ui/main_window.py +5632 -232
- lazylabel/ui/modes/__init__.py +6 -0
- lazylabel/ui/modes/base_mode.py +52 -0
- lazylabel/ui/modes/multi_view_mode.py +1173 -0
- lazylabel/ui/modes/single_view_mode.py +299 -0
- lazylabel/ui/photo_viewer.py +31 -3
- lazylabel/ui/test_hover.py +48 -0
- lazylabel/ui/widgets/adjustments_widget.py +2 -2
- lazylabel/ui/widgets/border_crop_widget.py +11 -0
- lazylabel/ui/widgets/channel_threshold_widget.py +50 -6
- lazylabel/ui/widgets/fft_threshold_widget.py +116 -22
- lazylabel/ui/widgets/model_selection_widget.py +117 -4
- {lazylabel_gui-1.2.1.dist-info → lazylabel_gui-1.3.1.dist-info}/METADATA +194 -200
- {lazylabel_gui-1.2.1.dist-info → lazylabel_gui-1.3.1.dist-info}/RECORD +25 -20
- {lazylabel_gui-1.2.1.dist-info → lazylabel_gui-1.3.1.dist-info}/WHEEL +0 -0
- {lazylabel_gui-1.2.1.dist-info → lazylabel_gui-1.3.1.dist-info}/entry_points.txt +0 -0
- {lazylabel_gui-1.2.1.dist-info → lazylabel_gui-1.3.1.dist-info}/licenses/LICENSE +0 -0
- {lazylabel_gui-1.2.1.dist-info → lazylabel_gui-1.3.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
"""Base class for mode handlers."""
|
2
|
+
|
3
|
+
from abc import ABC, abstractmethod
|
4
|
+
from typing import TYPE_CHECKING
|
5
|
+
|
6
|
+
if TYPE_CHECKING:
|
7
|
+
from ..main_window import MainWindow
|
8
|
+
|
9
|
+
|
10
|
+
class BaseModeHandler(ABC):
|
11
|
+
"""Base class for mode handlers."""
|
12
|
+
|
13
|
+
def __init__(self, main_window: "MainWindow"):
|
14
|
+
self.main_window = main_window
|
15
|
+
self.segment_manager = main_window.segment_manager
|
16
|
+
self.model_manager = main_window.model_manager
|
17
|
+
self.file_manager = main_window.file_manager
|
18
|
+
|
19
|
+
@abstractmethod
|
20
|
+
def handle_ai_click(self, pos, event):
|
21
|
+
"""Handle AI mode click."""
|
22
|
+
pass
|
23
|
+
|
24
|
+
@abstractmethod
|
25
|
+
def handle_polygon_click(self, pos):
|
26
|
+
"""Handle polygon mode click."""
|
27
|
+
pass
|
28
|
+
|
29
|
+
@abstractmethod
|
30
|
+
def handle_bbox_start(self, pos):
|
31
|
+
"""Handle bbox mode start."""
|
32
|
+
pass
|
33
|
+
|
34
|
+
@abstractmethod
|
35
|
+
def handle_bbox_drag(self, pos):
|
36
|
+
"""Handle bbox mode drag."""
|
37
|
+
pass
|
38
|
+
|
39
|
+
@abstractmethod
|
40
|
+
def handle_bbox_complete(self, pos):
|
41
|
+
"""Handle bbox mode completion."""
|
42
|
+
pass
|
43
|
+
|
44
|
+
@abstractmethod
|
45
|
+
def display_all_segments(self):
|
46
|
+
"""Display all segments."""
|
47
|
+
pass
|
48
|
+
|
49
|
+
@abstractmethod
|
50
|
+
def clear_all_points(self):
|
51
|
+
"""Clear all points."""
|
52
|
+
pass
|