ok-script 0.0.87__tar.gz → 0.0.89__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.
- {ok-script-0.0.87 → ok-script-0.0.89}/PKG-INFO +1 -1
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/adb/DeviceManager.py +1 -1
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/feature/FeatureSet.py +62 -62
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/debug/LogWindow.py +2 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/ocr/OCR.py +3 -3
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/update/Updater.py +35 -23
- {ok-script-0.0.87 → ok-script-0.0.89}/ok_script.egg-info/PKG-INFO +1 -1
- {ok-script-0.0.87 → ok-script-0.0.89}/setup.py +1 -1
- {ok-script-0.0.87 → ok-script-0.0.89}/README.md +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/OK.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/alas/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/alas/emulator_base.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/alas/emulator_windows.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/alas/platform_base.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/alas/platform_windows.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/alas/utils.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/BaseCaptureMethod.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/HwndWindow.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/adb/ADBCaptureMethod.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/adb/WindowsCaptureFactory.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/adb/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/adb/bin/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/image/ImageCaptureMethod.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/image/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/BaseWindowsCaptureMethod.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/BitBltCaptureMethod.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/DesktopDuplicationCaptureMethod.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/WindowsGraphicsCaptureMethod.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/d3d11.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/dump.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/utils.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/capture/windows/window.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/color/Color.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/color/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/config/Config.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/config/InfoDict.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/config/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/feature/Box.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/feature/CompressCoco.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/feature/Feature.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/feature/FindFeature.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/feature/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/firebase/Analytics.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/firebase/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/App.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/Communicate.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/MainWindow.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/MessageWindow.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/StartController.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/TabTitles.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/about/AboutTab.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/about/HttpTextEdit.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/about/VersionCard.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/about/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/common/OKIcon.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/common/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/common/config.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/common/style_sheet.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/debug/AspectRatioWidget.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/debug/DebugTab.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/debug/FrameWidget.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/debug/InfoWidget.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/debug/Screenshot.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/debug/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/i18n/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/i18n/path.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/i18n/update.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/icon/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/icon/icon.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/overlay/OverlayWindow.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/overlay/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/qss/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/resources.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/settings/SettingTab.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/settings/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/start/SelectCaptureListView.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/start/StartCard.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/start/StartTab.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/start/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/ConfigItemFactory.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/ConfigLabelAndWidget.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/LabelAndDoubleSpinBox.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/LabelAndDropDown.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/LabelAndLineEdit.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/LabelAndList.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/LabelAndSpinBox.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/LabelAndSwitchButton.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/LabelAndWidget.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/ModifyListDialog.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/ModifyListItem.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/OneTimeTaskTab.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/StartButton.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/TaskCard.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/TaskOpButton.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/TooltipTableWidget.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/TriggerTaskTab.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/tasks/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/util/Alert.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/util/InitWorker.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/util/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/Card.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/EmptyCard.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/FramelessDialog.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/ListTableWidgetItem.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/NumericTableWidgetItem.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/StartLoadingDialog.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/StatusBar.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/Tab.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/TabWidget.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/YesNonWidgetItem.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/gui/widget/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/interaction/ADBInteraction.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/interaction/BaseInteraction.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/interaction/DoNothingInteraction.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/interaction/Win32Interaction.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/interaction/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/logging/Logger.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/logging/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/ocr/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/delegate.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/export.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/idldsl.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/inspectable.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/roapi.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/types.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/winstring.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/save/BlackBarProcessor.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/save/PostProcessor.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/save/SaveByInterval.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/save/SaveByKeyPress.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/save/SaveMethodBase.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/save/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/scene/FeatureScene.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/scene/Scene.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/scene/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/stats/StreamStats.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/stats/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/task/BaseTask.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/task/ExecutorOperation.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/task/TaskExecutor.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/task/TriggerTask.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/task/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/update/GithubMultiDownloader.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/update/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/update/gen_md5.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/Handler.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/exit_event.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/json.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/list.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/path.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/thread.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/win32_process.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok/util/yaml.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok_script.egg-info/SOURCES.txt +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok_script.egg-info/requires.txt +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/ok_script.egg-info/top_level.txt +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/setup.cfg +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/tests/__init__.py +0 -0
- {ok-script-0.0.87 → ok-script-0.0.89}/tests/test_updater.py +0 -0
|
@@ -263,7 +263,7 @@ class DeviceManager:
|
|
|
263
263
|
self.use_windows_capture()
|
|
264
264
|
if not isinstance(self.interaction, Win32Interaction):
|
|
265
265
|
self.interaction = Win32Interaction(self.capture_method)
|
|
266
|
-
preferred['connected'] = self.capture_method.connected()
|
|
266
|
+
preferred['connected'] = self.capture_method is not None and self.capture_method.connected()
|
|
267
267
|
else:
|
|
268
268
|
width, height = self.get_resolution()
|
|
269
269
|
if self.config.get('capture') == "windows":
|
|
@@ -49,14 +49,15 @@ class FeatureSet:
|
|
|
49
49
|
self.lock = threading.Lock()
|
|
50
50
|
|
|
51
51
|
def check_size(self, frame):
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
self.
|
|
52
|
+
with self.lock:
|
|
53
|
+
height, width = frame.shape[:2]
|
|
54
|
+
if self.width != width or self.height != height and height > 0 and width > 0:
|
|
55
|
+
logger.info(f"FeatureSet: Width and height changed from {self.width}x{self.height} to {width}x{height}")
|
|
56
|
+
self.width = width
|
|
57
|
+
self.height = height
|
|
58
|
+
self.process_data()
|
|
59
|
+
elif not self.feature_dict:
|
|
60
|
+
self.process_data()
|
|
60
61
|
|
|
61
62
|
def process_data(self) -> None:
|
|
62
63
|
"""
|
|
@@ -66,60 +67,59 @@ class FeatureSet:
|
|
|
66
67
|
width (int): Target width for scaling images.
|
|
67
68
|
height (int): Target height for scaling images.
|
|
68
69
|
"""
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
self.box_dict[category_name] = Box(x, y, w, h, name=category_name)
|
|
70
|
+
if self.debug:
|
|
71
|
+
folder_size = sum(os.path.getsize(os.path.join(dirpath, filename))
|
|
72
|
+
for dirpath, dirnames, filenames in os.walk(self.coco_folder)
|
|
73
|
+
for filename in filenames)
|
|
74
|
+
# Convert size to MB
|
|
75
|
+
folder_size_mb = folder_size / (1024 * 1024)
|
|
76
|
+
if folder_size_mb > 5:
|
|
77
|
+
from ok.feature.CompressCoco import compress_coco
|
|
78
|
+
logger.info(f'template folder greater than 5MB try to compress the COCO dataset')
|
|
79
|
+
compress_coco(self.coco_json)
|
|
80
|
+
self.feature_dict.clear()
|
|
81
|
+
self.box_dict.clear()
|
|
82
|
+
with open(self.coco_json, 'r') as file:
|
|
83
|
+
data = json.load(file)
|
|
84
|
+
|
|
85
|
+
# Create a map from image ID to file name
|
|
86
|
+
image_map = {image['id']: image['file_name'] for image in data['images']}
|
|
87
|
+
|
|
88
|
+
# Create a map from category ID to category name
|
|
89
|
+
category_map = {category['id']: category['name'] for category in data['categories']}
|
|
90
|
+
|
|
91
|
+
for annotation in data['annotations']:
|
|
92
|
+
image_id = annotation['image_id']
|
|
93
|
+
category_id = annotation['category_id']
|
|
94
|
+
bbox = annotation['bbox']
|
|
95
|
+
|
|
96
|
+
# Load and scale the image
|
|
97
|
+
image_path = str(os.path.join(self.coco_folder, image_map[image_id]))
|
|
98
|
+
image = cv2.imread(image_path)
|
|
99
|
+
_, original_width = image.shape[:2]
|
|
100
|
+
if image is None:
|
|
101
|
+
logger.error(f'Could not read image {image_path}')
|
|
102
|
+
continue
|
|
103
|
+
x, y, w, h = bbox
|
|
104
|
+
if self.width != image.shape[1] or self.height != image.shape[0]:
|
|
105
|
+
scale_x, scale_y = self.width / image.shape[1], self.height / image.shape[0]
|
|
106
|
+
logger.debug(f'scaling images {scale_x}, {scale_y}')
|
|
107
|
+
image = cv2.resize(image, (self.width, self.height))
|
|
108
|
+
# Calculate the scaled bounding box
|
|
109
|
+
x, y, w, h = x * scale_x, y * scale_y, w * scale_x, h * scale_y
|
|
110
|
+
|
|
111
|
+
# Crop the image to the bounding box
|
|
112
|
+
image = image[round(y):round(y + h), round(x):round(x + w), :3]
|
|
113
|
+
|
|
114
|
+
# Store in featureDict using the category name
|
|
115
|
+
category_name = category_map[category_id]
|
|
116
|
+
logger.debug(
|
|
117
|
+
f"loaded {category_name} resized width {self.width} / original_width:{original_width},scale_x:{self.width / original_width}")
|
|
118
|
+
if category_name in self.feature_dict:
|
|
119
|
+
raise ValueError(f"Multiple boxes found for category {category_name}")
|
|
120
|
+
if not category_name.startswith('box_'):
|
|
121
|
+
self.feature_dict[category_name] = Feature(image, x, y, w, h)
|
|
122
|
+
self.box_dict[category_name] = Box(x, y, w, h, name=category_name)
|
|
123
123
|
|
|
124
124
|
def get_box_by_name(self, mat, category_name: str) -> Box:
|
|
125
125
|
self.check_size(mat)
|
|
@@ -69,6 +69,8 @@ class LogModel(QAbstractListModel):
|
|
|
69
69
|
self.beginInsertRows(QModelIndex(), self.rowCount(QModelIndex()), self.rowCount(QModelIndex()))
|
|
70
70
|
self.do_filter_logs()
|
|
71
71
|
self.endInsertRows()
|
|
72
|
+
self.layoutChanged.emit()
|
|
73
|
+
self.log_list.scrollToBottom()
|
|
72
74
|
|
|
73
75
|
def do_filter_logs(self):
|
|
74
76
|
|
|
@@ -55,13 +55,13 @@ class OCR:
|
|
|
55
55
|
pos = res[0]
|
|
56
56
|
text = res[1]
|
|
57
57
|
confidence = res[2]
|
|
58
|
-
width, height =
|
|
58
|
+
width, height = round(pos[2][0] - pos[0][0]), round(pos[2][1] - pos[0][1])
|
|
59
59
|
if width <= 0 or height <= 0:
|
|
60
60
|
logger.error(f'ocr result negative box {text} {confidence} {width}x{height} pos:{pos}')
|
|
61
61
|
continue
|
|
62
62
|
if confidence >= threshold:
|
|
63
|
-
detected_box = Box(
|
|
64
|
-
|
|
63
|
+
detected_box = Box(pos[0][0], pos[0][1], width,
|
|
64
|
+
height,
|
|
65
65
|
confidence, text)
|
|
66
66
|
scale_box(detected_box, scale_factor)
|
|
67
67
|
if box is not None:
|
|
@@ -70,27 +70,10 @@ REM Check all PIDs every second and terminate them after 10 seconds if still run
|
|
|
70
70
|
set "check_duration=10"
|
|
71
71
|
|
|
72
72
|
for %%A in (%pid_list%) do (
|
|
73
|
-
|
|
74
|
-
:check_loop
|
|
75
|
-
echo %time% - Waiting for PID %%A to exit...
|
|
76
|
-
tasklist /fi "PID eq %%A" | find ":" >nul
|
|
77
|
-
if errorlevel 1 (
|
|
78
|
-
echo %time% - PID %%A has exited.
|
|
79
|
-
goto next_pid
|
|
80
|
-
) else (
|
|
81
|
-
timeout /t 1 /nobreak >nul
|
|
82
|
-
set /a elapsed_time+=1
|
|
83
|
-
if !elapsed_time! geq %check_duration% (
|
|
84
|
-
echo %time% - PID %%A is still running after %check_duration% seconds, killing it...
|
|
85
|
-
taskkill /f /pid %%A
|
|
86
|
-
goto next_pid
|
|
87
|
-
)
|
|
88
|
-
goto check_loop
|
|
89
|
-
)
|
|
90
|
-
:next_pid
|
|
91
|
-
echo %time% - continue
|
|
73
|
+
call :check_pid %%A
|
|
92
74
|
)
|
|
93
75
|
|
|
76
|
+
|
|
94
77
|
REM Sleep for one second
|
|
95
78
|
timeout /t 1 /nobreak >nul
|
|
96
79
|
|
|
@@ -114,6 +97,29 @@ for /D %%D in ("%source_dir%\*") do (
|
|
|
114
97
|
echo %time% Update Success
|
|
115
98
|
start "" %exe%
|
|
116
99
|
endlocal
|
|
100
|
+
pause
|
|
101
|
+
|
|
102
|
+
goto :eof
|
|
103
|
+
|
|
104
|
+
:check_pid
|
|
105
|
+
set "elapsed_time=0"
|
|
106
|
+
:check_loop
|
|
107
|
+
echo %time% - Waiting for PID %1 to exit...
|
|
108
|
+
tasklist /fi "PID eq %1" | find ":" >nul
|
|
109
|
+
if errorlevel 1 (
|
|
110
|
+
echo %time% - PID %1 has exited.
|
|
111
|
+
goto :eof
|
|
112
|
+
) else (
|
|
113
|
+
timeout /t 1 /nobreak >nul
|
|
114
|
+
set /a elapsed_time+=1
|
|
115
|
+
if !elapsed_time! geq %check_duration% (
|
|
116
|
+
echo %time% - PID %1 is still running after %check_duration% seconds, killing it...
|
|
117
|
+
taskkill /f /pid %1
|
|
118
|
+
goto :eof
|
|
119
|
+
)
|
|
120
|
+
goto check_loop
|
|
121
|
+
)
|
|
122
|
+
goto :eof
|
|
117
123
|
'''
|
|
118
124
|
|
|
119
125
|
|
|
@@ -287,17 +293,23 @@ class Updater:
|
|
|
287
293
|
return True
|
|
288
294
|
|
|
289
295
|
def update(self):
|
|
296
|
+
ok.gui.device_manager.adb_kill_server()
|
|
290
297
|
exe_folder = get_path_relative_to_exe()
|
|
291
298
|
batch_command = [self.to_update.get("updater_bat"), self.to_update.get("update_package_folder"), exe_folder,
|
|
292
|
-
os.path.join(exe_folder, self.exe_name),
|
|
293
|
-
for proc in psutil.process_iter(['pid', 'name']):
|
|
294
|
-
if proc.info['name'] == 'adb.exe'
|
|
299
|
+
os.path.join(exe_folder, self.exe_name), str(os.getpid())]
|
|
300
|
+
for proc in psutil.process_iter(['pid', 'name', 'exe']):
|
|
301
|
+
if proc.info['name'] == 'adb.exe' and os.path.normpath(proc.info['exe']).startswith(
|
|
302
|
+
os.path.normpath(exe_folder)):
|
|
303
|
+
try:
|
|
304
|
+
logger.info(f'try kill the adb process {proc.info}')
|
|
305
|
+
proc.kill()
|
|
306
|
+
except Exception as e:
|
|
307
|
+
logger.error(f'kill process error', e)
|
|
295
308
|
batch_command.append(str(proc.info['pid']))
|
|
296
309
|
|
|
297
310
|
logger.info(f'execute update {batch_command}')
|
|
298
311
|
|
|
299
312
|
subprocess.Popen(batch_command, creationflags=subprocess.CREATE_NEW_CONSOLE)
|
|
300
|
-
ok.gui.device_manager.adb_kill_server()
|
|
301
313
|
ok.gui.ok.quit()
|
|
302
314
|
|
|
303
315
|
def check_package_error(self):
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ok-script-0.0.87 → ok-script-0.0.89}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py
RENAMED
|
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
|
|
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
|
|
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
|