LabelCraft 2.1.4__tar.gz → 2.1.6__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.
Files changed (104) hide show
  1. {labelcraft-2.1.4 → labelcraft-2.1.6}/LabelCraft.egg-info/PKG-INFO +3 -3
  2. {labelcraft-2.1.4 → labelcraft-2.1.6}/PKG-INFO +3 -3
  3. {labelcraft-2.1.4 → labelcraft-2.1.6}/README.md +2 -2
  4. {labelcraft-2.1.4 → labelcraft-2.1.6}/labelcraft_ui.py +6 -0
  5. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/__init__.py +1 -1
  6. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/colorDialog.py +20 -3
  7. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/theme_manager.py +7 -2
  8. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/utils.py +16 -0
  9. {labelcraft-2.1.4 → labelcraft-2.1.6}/setup.py +0 -29
  10. {labelcraft-2.1.4 → labelcraft-2.1.6}/LabelCraft.egg-info/SOURCES.txt +0 -0
  11. {labelcraft-2.1.4 → labelcraft-2.1.6}/LabelCraft.egg-info/dependency_links.txt +0 -0
  12. {labelcraft-2.1.4 → labelcraft-2.1.6}/LabelCraft.egg-info/entry_points.txt +0 -0
  13. {labelcraft-2.1.4 → labelcraft-2.1.6}/LabelCraft.egg-info/not-zip-safe +0 -0
  14. {labelcraft-2.1.4 → labelcraft-2.1.6}/LabelCraft.egg-info/requires.txt +0 -0
  15. {labelcraft-2.1.4 → labelcraft-2.1.6}/LabelCraft.egg-info/top_level.txt +0 -0
  16. {labelcraft-2.1.4 → labelcraft-2.1.6}/MANIFEST.in +0 -0
  17. {labelcraft-2.1.4 → labelcraft-2.1.6}/data/coco_classes.txt +0 -0
  18. {labelcraft-2.1.4 → labelcraft-2.1.6}/data/predefined_classes.txt +0 -0
  19. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/annotation_converter.py +0 -0
  20. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/annotation_importer.py +0 -0
  21. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/canvas.py +0 -0
  22. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/cli.py +0 -0
  23. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/coco_io.py +0 -0
  24. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/combobox.py +0 -0
  25. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/constants.py +0 -0
  26. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/create_ml_io.py +0 -0
  27. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/csv_io.py +0 -0
  28. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/default_label_combobox.py +0 -0
  29. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/hashableQListWidgetItem.py +0 -0
  30. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/i18n_engine.py +0 -0
  31. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/json_io.py +0 -0
  32. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/labelDialog.py +0 -0
  33. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/labelFile.py +0 -0
  34. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/lightWidget.py +0 -0
  35. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/locales/de-DE.json +0 -0
  36. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/locales/en.json +0 -0
  37. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/locales/fr-FR.json +0 -0
  38. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/locales/ja-JP.json +0 -0
  39. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/locales/zh-CN.json +0 -0
  40. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/locales/zh-TW.json +0 -0
  41. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/newProjectDialog.py +0 -0
  42. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/pascal_voc_io.py +0 -0
  43. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/project.py +0 -0
  44. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/resources.py +0 -0
  45. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/settings.py +0 -0
  46. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/shape.py +0 -0
  47. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/toolBar.py +0 -0
  48. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/ustr.py +0 -0
  49. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/yolo_io.py +0 -0
  50. {labelcraft-2.1.4 → labelcraft-2.1.6}/libs/zoomWidget.py +0 -0
  51. {labelcraft-2.1.4 → labelcraft-2.1.6}/main.py +0 -0
  52. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/app.icns +0 -0
  53. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/app.png +0 -0
  54. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/app.svg +0 -0
  55. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/app_screen.png +0 -0
  56. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/cancel.png +0 -0
  57. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/close.png +0 -0
  58. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/color.png +0 -0
  59. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/color_line.png +0 -0
  60. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/copy.png +0 -0
  61. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/delete.png +0 -0
  62. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/done.png +0 -0
  63. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/done.svg +0 -0
  64. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/edit.png +0 -0
  65. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/expert1.png +0 -0
  66. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/expert2.png +0 -0
  67. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/eye.png +0 -0
  68. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/feBlend-icon.png +0 -0
  69. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/file.png +0 -0
  70. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/fit-width.png +0 -0
  71. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/fit-window.png +0 -0
  72. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/fit.png +0 -0
  73. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/format_createml.png +0 -0
  74. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/format_voc.png +0 -0
  75. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/format_yolo.png +0 -0
  76. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/help.png +0 -0
  77. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/labels.png +0 -0
  78. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/labels.svg +0 -0
  79. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/light_brighten.svg +0 -0
  80. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/light_darken.png +0 -0
  81. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/light_darken.svg +0 -0
  82. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/light_lighten.png +0 -0
  83. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/light_reset.png +0 -0
  84. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/light_reset.svg +0 -0
  85. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/new.png +0 -0
  86. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/next.png +0 -0
  87. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/objects.png +0 -0
  88. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/open.png +0 -0
  89. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/open.svg +0 -0
  90. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/prev.png +0 -0
  91. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/quit.png +0 -0
  92. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/resetall.png +0 -0
  93. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/save-as.png +0 -0
  94. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/save-as.svg +0 -0
  95. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/save.png +0 -0
  96. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/save.svg +0 -0
  97. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/undo-cross.png +0 -0
  98. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/undo.png +0 -0
  99. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/verify.png +0 -0
  100. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/zoom-in.png +0 -0
  101. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/zoom-out.png +0 -0
  102. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources/icons/zoom.png +0 -0
  103. {labelcraft-2.1.4 → labelcraft-2.1.6}/resources.qrc +0 -0
  104. {labelcraft-2.1.4 → labelcraft-2.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LabelCraft
3
- Version: 2.1.4
3
+ Version: 2.1.6
4
4
  Summary: LabelCraft - A modern graphical image annotation tool based on labelImg
5
5
  Home-page: https://github.com/syd168/LabelCraft
6
6
  Author: LabelCraft Contributors
@@ -37,12 +37,12 @@ Dynamic: summary
37
37
 
38
38
  # LabelCraft - Intelligent Image Annotation Tool
39
39
 
40
- > **Version 2.1.4** - A modern image annotation tool with project management and cross-platform support, developed based on [labelImg](https://github.com/tzutalin/labelImg)
40
+ > **Version 2.1.6** - A modern image annotation tool with project management and cross-platform support, developed based on [labelImg](https://github.com/tzutalin/labelImg)
41
41
 
42
42
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
43
43
  [![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)
44
44
  [![PySide6](https://img.shields.io/badge/PySide6-6.5+-green.svg)](https://www.qt.io/)
45
- [![Version](https://img.shields.io/badge/version-2.1.4-orange.svg)](https://github.com/syd168/LabelCraft/releases)
45
+ [![Version](https://img.shields.io/badge/version-2.1.6-orange.svg)](https://github.com/syd168/LabelCraft/releases)
46
46
  [![Downloads](https://pepy.tech/badge/labelcraft)](https://pepy.tech/project/labelcraft)
47
47
  [![PyPI](https://img.shields.io/pypi/v/labelcraft.svg)](https://pypi.org/project/LabelCraft/)
48
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LabelCraft
3
- Version: 2.1.4
3
+ Version: 2.1.6
4
4
  Summary: LabelCraft - A modern graphical image annotation tool based on labelImg
5
5
  Home-page: https://github.com/syd168/LabelCraft
6
6
  Author: LabelCraft Contributors
@@ -37,12 +37,12 @@ Dynamic: summary
37
37
 
38
38
  # LabelCraft - Intelligent Image Annotation Tool
39
39
 
40
- > **Version 2.1.4** - A modern image annotation tool with project management and cross-platform support, developed based on [labelImg](https://github.com/tzutalin/labelImg)
40
+ > **Version 2.1.6** - A modern image annotation tool with project management and cross-platform support, developed based on [labelImg](https://github.com/tzutalin/labelImg)
41
41
 
42
42
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
43
43
  [![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)
44
44
  [![PySide6](https://img.shields.io/badge/PySide6-6.5+-green.svg)](https://www.qt.io/)
45
- [![Version](https://img.shields.io/badge/version-2.1.4-orange.svg)](https://github.com/syd168/LabelCraft/releases)
45
+ [![Version](https://img.shields.io/badge/version-2.1.6-orange.svg)](https://github.com/syd168/LabelCraft/releases)
46
46
  [![Downloads](https://pepy.tech/badge/labelcraft)](https://pepy.tech/project/labelcraft)
47
47
  [![PyPI](https://img.shields.io/pypi/v/labelcraft.svg)](https://pypi.org/project/LabelCraft/)
48
48
 
@@ -1,11 +1,11 @@
1
1
  # LabelCraft - Intelligent Image Annotation Tool
2
2
 
3
- > **Version 2.1.4** - A modern image annotation tool with project management and cross-platform support, developed based on [labelImg](https://github.com/tzutalin/labelImg)
3
+ > **Version 2.1.6** - A modern image annotation tool with project management and cross-platform support, developed based on [labelImg](https://github.com/tzutalin/labelImg)
4
4
 
5
5
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
6
  [![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)
7
7
  [![PySide6](https://img.shields.io/badge/PySide6-6.5+-green.svg)](https://www.qt.io/)
8
- [![Version](https://img.shields.io/badge/version-2.1.4-orange.svg)](https://github.com/syd168/LabelCraft/releases)
8
+ [![Version](https://img.shields.io/badge/version-2.1.6-orange.svg)](https://github.com/syd168/LabelCraft/releases)
9
9
  [![Downloads](https://pepy.tech/badge/labelcraft)](https://pepy.tech/project/labelcraft)
10
10
  [![PyPI](https://img.shields.io/pypi/v/labelcraft.svg)](https://pypi.org/project/LabelCraft/)
11
11
 
@@ -5306,6 +5306,12 @@ def get_main_app(argv=None):
5306
5306
  """
5307
5307
  if not argv:
5308
5308
  argv = []
5309
+ argv = filter_platform_argv(argv)
5310
+
5311
+ # Required for proper Qt rendering when launched from macOS .app bundles
5312
+ if platform.system() == 'Darwin':
5313
+ os.environ.setdefault('QT_MAC_WANTS_LAYER', '1')
5314
+
5309
5315
  app = QApplication(argv)
5310
5316
  app.setApplicationName(__appname__)
5311
5317
  app.setWindowIcon(new_icon("app"))
@@ -1,2 +1,2 @@
1
- __version_info__ = ('2', '1', '4')
1
+ __version_info__ = ('2', '1', '6')
2
2
  __version__ = '.'.join(__version_info__)
@@ -16,9 +16,10 @@ class ColorDialog(QColorDialog):
16
16
  # The default is set at invocation time, so that it
17
17
  # works across dialogs for different elements.
18
18
  self.default = None
19
- self.bb = self.layout().itemAt(1).widget()
20
- self.bb.addButton(BB.RestoreDefaults)
21
- self.bb.clicked.connect(self.check_restore)
19
+ self.bb = self._find_button_box()
20
+ if self.bb is not None:
21
+ self.bb.addButton(BB.RestoreDefaults)
22
+ self.bb.clicked.connect(self.check_restore)
22
23
 
23
24
  # Store parent reference for i18n
24
25
  self.parent_window = parent
@@ -27,6 +28,20 @@ class ColorDialog(QColorDialog):
27
28
  if parent and hasattr(parent, 'i18n'):
28
29
  parent.i18n.language_changed.connect(self.retranslate)
29
30
 
31
+ def _find_button_box(self):
32
+ """Locate the button box; layout index differs across platforms."""
33
+ layout = self.layout()
34
+ if layout is None:
35
+ return None
36
+ for i in range(layout.count()):
37
+ item = layout.itemAt(i)
38
+ if item is None:
39
+ continue
40
+ widget = item.widget()
41
+ if isinstance(widget, QDialogButtonBox):
42
+ return widget
43
+ return None
44
+
30
45
  def tr(self, key: str, default: str = None, **kwargs):
31
46
  """
32
47
  Translate a string - standard i18n method name (Qt convention).
@@ -57,6 +72,8 @@ class ColorDialog(QColorDialog):
57
72
  return self.currentColor() if self.exec() else None
58
73
 
59
74
  def check_restore(self, button):
75
+ if self.bb is None:
76
+ return
60
77
  # In PySide6/Qt6, buttonRole returns an enum, need to use .value for bitwise operation
61
78
  role = self.bb.buttonRole(button)
62
79
  role_value = role.value if hasattr(role, 'value') else role
@@ -53,10 +53,14 @@ def _create_dark_palette():
53
53
  dark_palette.setColor(QPalette.ColorRole.ToolTipBase, light_text)
54
54
  dark_palette.setColor(QPalette.ColorRole.ToolTipText, dark_bg)
55
55
 
56
+ # Placeholder text (input hint text)
57
+ dark_palette.setColor(QPalette.ColorRole.PlaceholderText, QColor(150, 150, 150))
58
+
56
59
  # Disabled state
57
60
  dark_palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.WindowText, QColor(128, 128, 128))
58
61
  dark_palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.Text, QColor(128, 128, 128))
59
62
  dark_palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.ButtonText, QColor(128, 128, 128))
63
+ dark_palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.PlaceholderText, QColor(80, 80, 80))
60
64
 
61
65
  return dark_palette
62
66
 
@@ -191,8 +195,9 @@ def _detect_macos_dark_mode():
191
195
  text=True,
192
196
  timeout=2
193
197
  )
194
- # If the command returns 'Dark', dark mode is enabled
195
- return 'Dark' in result.stdout or result.returncode == 0
198
+ if result.returncode != 0:
199
+ return False
200
+ return 'dark' in result.stdout.strip().lower()
196
201
  except (FileNotFoundError, subprocess.TimeoutExpired, Exception):
197
202
  # If the command fails, assume light mode (default on macOS)
198
203
  return False
@@ -9,6 +9,22 @@ from PySide6.QtCore import *
9
9
  from PySide6.QtWidgets import *
10
10
 
11
11
 
12
+ def filter_platform_argv(argv):
13
+ """
14
+ Remove OS-injected launch arguments that break argparse.
15
+
16
+ macOS Finder/Dock injects -psn_* when launching GUI apps from .app bundles.
17
+ """
18
+ if not argv:
19
+ return argv
20
+ filtered = [argv[0]]
21
+ for arg in argv[1:]:
22
+ if arg.startswith('-psn_'):
23
+ continue
24
+ filtered.append(arg)
25
+ return filtered
26
+
27
+
12
28
  def new_icon(icon):
13
29
  return QIcon(':/' + icon)
14
30
 
@@ -2,7 +2,6 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  from setuptools import setup, find_packages, Command
5
- from sys import platform as _platform
6
5
  from shutil import rmtree
7
6
  import sys
8
7
  import os
@@ -34,33 +33,8 @@ try:
34
33
  except FileNotFoundError:
35
34
  history = ''
36
35
 
37
- SET_REQUIRES = []
38
- if _platform == "darwin":
39
- SET_REQUIRES.append('py2app')
40
-
41
36
  required_packages = find_packages(exclude=['tests', 'build', 'dist'])
42
37
 
43
- APP = ['main.py']
44
- OPTIONS = {
45
- 'argv_emulation': True,
46
- 'iconfile': 'resources/icons/app.icns',
47
- 'packages': [
48
- 'PySide6',
49
- 'lxml',
50
- 'xml',
51
- 'xml.etree',
52
- 'json',
53
- 'csv',
54
- 'io',
55
- 'codecs',
56
- ],
57
- 'excludes': [
58
- 'PySide6.QtNetwork',
59
- 'PySide6.QtWebEngineCore',
60
- 'PySide6.QtWebEngineWidgets',
61
- ]
62
- }
63
-
64
38
  class UploadCommand(Command):
65
39
  """Support setup.py upload."""
66
40
 
@@ -103,7 +77,6 @@ class UploadCommand(Command):
103
77
 
104
78
 
105
79
  setup(
106
- app=APP if _platform == "darwin" else None,
107
80
  name=NAME,
108
81
  version=about['__version__'],
109
82
  description="LabelCraft - A modern graphical image annotation tool based on labelImg",
@@ -142,8 +115,6 @@ setup(
142
115
  'Topic :: Scientific/Engineering :: Artificial Intelligence',
143
116
  'Topic :: Multimedia :: Graphics',
144
117
  ],
145
- options={'py2app': OPTIONS} if _platform == "darwin" else {},
146
- setup_requires=SET_REQUIRES,
147
118
  # $ setup.py publish support.
148
119
  cmdclass={
149
120
  'upload': UploadCommand,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes