-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adaptive resizing for masked images #177
Merged
Toufool
merged 1 commit into
Toufool:2.0.0
from
Avasam:adaptive-resize-for-masked-images
Oct 29, 2022
Merged
Adaptive resizing for masked images #177
Toufool
merged 1 commit into
Toufool:2.0.0
from
Avasam:adaptive-resize-for-masked-images
Oct 29, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Especially in the case of 1080p or higher, if the non-transparent area of the mask image used for the split is small, resizing the entire image to 320x240 will lose the information inside the mask. One idea to prevent this is to adaptively determine the target size according to the number of nonzero elements in the alpha channel of the split image. At least for the L2 norm and histogram, such a change would not affect performance since they only use information about the mask's interior. Masks are not recommended with pHash anyway.
Avasam
force-pushed
the
adaptive-resize-for-masked-images
branch
from
October 25, 2022 03:54
4d74150
to
890eb6c
Compare
Toufool
added a commit
that referenced
this pull request
Mar 25, 2023
* First linting pass Configured VSCode and Markdownlint settings Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper [Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method Hide generated/compiled files SelectRegionWidget width and height as functions Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter * Moved most settings to pyproject.toml and ran autopep8 * Removed mypy and Fixed import-outside-toplevel * Double quotes and pylint complete linting * Configured linting workflow * add pause after start image tip * Fix crash on LiveSplit open and missing link in error message * Merge * Fixed certificate error and random crash on open when compiled * Using python/typeshed/pull/6492 * PEP8 naming convention * Added build artifact * AutoSplitImage Class and simplified code Simplified and reduced image conversions Reduced duplicated code, especially in settings Build Artifact * Average FPS over all images with all actions * Added badges * Fixed "Select Window" not working for windows with negative coordinates Split screen_region in smaller functions WIP towards #94: No pop-up on loading settings with no capture window Don't stop/reset AutoSplit upon loosing capture window No pop-up on loosing capture window Don't allow selecting desktop. * Ability to recover window Fixed regressions: Fix crash on clising window mid-run Forgot to migrate split_delay to image.delay Removed dead load_pyqt_settings code Fixed dummy groups Pause time from filename not set correctly Setting hotkeys on load * Differentiate "undo/skip split" from "previous/next image" Skip/udo will now actually call command This makes grouping option obsolete as user now has finer control anyway UI is a bit cramped, but that should be resolved with UI revamp Updated README * Make Save Settings more intuitive Don't close if user has cancelled "saving sattings as" Removed more attributes from AutoSplit class Don't update last_successfully_loaded_settings_file_path if load was not successful "Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe When closing app, ue save_settings instead of save_settings_as * Initial UI update for 2.0.0. Add settings window. * Hooked new settings window to actual values (#151) * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group Co-authored-by: Austin <[email protected]> * Image comparison method and default delay time (#135) * hooked new settings window to actual values * Implemented image specific comparison method and default delay time. Closes #26 * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group * Fixed images comparison method defaulting to 0 rather than none Co-authored-by: Austin <[email protected]> * Support hotkeys with modifiers (#136) * hooked new settings window to actual values * Better "seconds remaining" text * Support modifiers the same way LiveSplit does. Closes #34 * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group Co-authored-by: Austin <[email protected]> * Linted pyi files (#137) * hooked new settings window to actual values * Linted pyi files * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group * Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member) * Massively sped up Flake tests Removed 400+kb of type stubs * Centralized qWait typing fix * Autosort imports * Resynced settings Co-authored-by: Austin <[email protected]> * Toml profiles + Python 3.10 (#140) * Typings update * Full setup and configuration update * User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor * Added new Capture Method system for more capture options + utils (#141) * Add D3DShot types from python/typeshed#8652 * New Capture Method system * Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161) * Doc + Setup update * typings update * Warning if AutoSplit is already open + Build number + Splash Screen * Target the right repository/fork * Fix #155 * Actions shortcut and prevent double open window Closes #154 * ImageHash hotfix * Toggle autoreset image + ui adjustments (#164) * merge master into 2.0.0 (#165) * update credits * oops * Toggle autoreset image (#162) * Fix #52 Comparisons with empty masks * Save 'Check For Updates On Open' immediatly * showErrorSignal to show error message box from another thread * Fixes #86 Stop uncaught exceptions from silently crashing the app * Fixes #86 Stop uncaught exceptions from silently crashing the app * Fix #114, try to load Start Image on browse & load settings, don't allow a start image to load if hotkeys are not set. * First linting pass Configured VSCode and Markdownlint settings Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper [Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method Hide generated/compiled files SelectRegionWidget width and height as functions Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter * Moved most settings to pyproject.toml and ran autopep8 * Removed mypy and Fixed import-outside-toplevel * Double quotes and pylint complete linting * Configured linting workflow * Async check for updates * Fix crash on LiveSplit open and missing link in error message * Merge * Fixed certificate error and random crash on open when compiled * Using python/typeshed/pull/6492 * PEP8 naming convention * Added build artifact * AutoSplitImage Class and simplified code Simplified and reduced image conversions Reduced duplicated code, especially in settings Build Artifact * Average FPS over all images with all actions * Added badges * Fixed "Select Window" not working for windows with negative coordinates Split screen_region in smaller functions WIP towards #94: No pop-up on loading settings with no capture window Don't stop/reset AutoSplit upon loosing capture window No pop-up on loosing capture window Don't allow selecting desktop. * Ability to recover window Fixed regressions: Fix crash on clising window mid-run Forgot to migrate split_delay to image.delay Removed dead load_pyqt_settings code Fixed dummy groups Pause time from filename not set correctly Setting hotkeys on load * Differentiate "undo/skip split" from "previous/next image" Skip/udo will now actually call command This makes grouping option obsolete as user now has finer control anyway UI is a bit cramped, but that should be resolved with UI revamp Updated README * Make Save Settings more intuitive Don't close if user has cancelled "saving sattings as" Removed more attributes from AutoSplit class Don't update last_successfully_loaded_settings_file_path if load was not successful "Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe When closing app, ue save_settings instead of save_settings_as * Initial UI update for 2.0.0. Add settings window. * Hooked new settings window to actual values (#151) * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group Co-authored-by: Austin <[email protected]> * Image comparison method and default delay time (#135) * hooked new settings window to actual values * Implemented image specific comparison method and default delay time. Closes #26 * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group * Fixed images comparison method defaulting to 0 rather than none Co-authored-by: Austin <[email protected]> * Support hotkeys with modifiers (#136) * hooked new settings window to actual values * Better "seconds remaining" text * Support modifiers the same way LiveSplit does. Closes #34 * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group Co-authored-by: Austin <[email protected]> * Linted pyi files (#137) * hooked new settings window to actual values * Linted pyi files * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group * Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member) * Massively sped up Flake tests Removed 400+kb of type stubs * Centralized qWait typing fix * Autosort imports * Resynced settings Co-authored-by: Austin <[email protected]> * Toml profiles + Python 3.10 (#140) * Typings update * Full setup and configuration update * User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor * Added new Capture Method system for more capture options + utils (#141) * Add D3DShot types from python/typeshed#8652 * New Capture Method system * Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161) * Doc + Setup update * typings update * Warning if AutoSplit is already open + Build number + Splash Screen * Target the right repository/fork * Fix #155 * Actions shortcut and prevent double open window Closes #154 * ImageHash hotfix * Toggle autoreset image + ui adjustments Co-authored-by: Austin <[email protected]> * Revert "Toggle autoreset image (#162)" (#163) This reverts commit 9e48c51. Co-authored-by: Samuel T <[email protected]> * test building without --windowed * First round of QA testing fixes (#171) * Added sonarcloud.properties * Remove duplicate DeleteDC & allow errors to show May fix #167 * Rename CaptureMethodInterface to CaptureMethodBase * Added autofix script and faster linting * Disable device probing for now. Fixes #169 * Updated settings widget text and workaround to fix #170 * Bump AUTOSPLIT_VERSION * Next Image even if it's not possible to split Fixes #168 * Fix build * First round of QA testing fixes + build fixes (#172) * back to windowed * Fix #47, updated some configs and types from typeshed (#173) * Updated configs * Updated typings * Updated some code * Fix #47 * Revert mypy stuff * More consistent formatting (#174) * More consistent formatting and types - Added autofixes to the lint script. - Added a quotes autofixer using `unify` - Added a trailing comma checker and autofixer - Applied trailing commas - Ordered requirements alphabetically - Ensure the last version of D3DShot is used (0.1.5, not 0.1.3) - Remove configuration for unused linters (black/prettier/sonarlint) - Updated types from typeshed * Updated virtual camera link * Update types and pylint * Batch fixes (#176) * pyright update * lint-and-build cover more files * Get IDirect3dDevice from LearningModelDevice Closes #175 Co-authored-by: Algomancer <[email protected]> * Ensure we're using the right camera size And not OpenCV's default 640x480 * Fix rounding error in displayed decimal * Revert "back to windowed" This reverts commit 9553271. * Fix highest similarity for start image * Fix split below treshold when image is not valid * Detect gray frames from OBS-Camera Co-authored-by: Algomancer <[email protected]> * Adaptive resizing for masked images (#177) Especially in the case of 1080p or higher, if the non-transparent area of the mask image used for the split is small, resizing the entire image to 320x240 will lose the information inside the mask. One idea to prevent this is to adaptively determine the target size according to the number of nonzero elements in the alpha channel of the split image. At least for the L2 norm and histogram, such a change would not affect performance since they only use information about the mask's interior. Masks are not recommended with pHash anyway. Co-authored-by: zalgo3 <[email protected]> * Bump opencv-python to 4.6 (#178) * Point python_grabber to andreaschiavinato (#179) * Batch of updates and fixes for 2.0.0 (#188) * Point python_grabber to andreaschiavinato * Added summary of histogram * Backport changes from linux branch * Improved pyright and formatters usage * Config updates * Fix links * Disable next/previous while delaying * proper `is_running` variable * Fix loading and clearing of start image * Rename "already_running" to "already_open" * Fix delay intervals * Add support for start image pause time * Default to MediaCapture's d3d * Re-enable buttons after delay * Beta 1 (feature-freeze, bugfixes only) * Updated configs to use Python 3.11 (#180) * Option to build without build number + Adaptive mask fix (#189) * Option to build without build number * Fix repo url from workflow build * Resize mask with image * Pin more dependencies, Speed-up installs and update comments * Add mypy config for optional support. * pin requests and allow pyright warnings (#193) * Fix B028 (#194) * Fixed run_start_time with start image pause loop (#197) Also fixed run_start_time not accounting for the delay in parsing images * Disable Capture device: dropdown when Capture method: is not Video Capture Device (#198) Fix issue with programatically setting capture_device_combobox index * Fix start issue after finishing splits (#199) * Fix start issue after finishing splits - `self.is_running = False` at the end of `__auto_splitter` - Revert moving initialization of some values - Move `self.run_start_time = time()` before parsing images * Update hardcoded references to repo name * Change default capture method to WGA (#200) * Delete example1.6.0.gif * 2.0.0 gif * update gif to 2.0.0 * Update some docs and fix lint issue (#202) * Update docs, comments and typings Add link to dev builds bump beta version Update flake8 checks "fix" typing issue caused by PyQt6 incorrect callable * Slight build improvement * Fix D3DDD issue on hybrid GPU laptops (#205) * Fix D3DDD issue on hybrid gpu laptops 1. Some Desktop Duplication setup was done in advance, even if that method won't be used 2. Hybrid GPU laptops can have issues with D3D Desktop Duplication. The issue and a workaround is now documented * Fixed some blocking typing and linting issues * Fix obs-camera image freezing for a sec when it gives a blank frame (#206) --------- Co-authored-by: Austin <[email protected]> Co-authored-by: Algomancer <[email protected]> Co-authored-by: zalgo3 <[email protected]>
Merged
Toufool
added a commit
that referenced
this pull request
Apr 22, 2023
* Fix #52 Comparisons with empty masks * Save 'Check For Updates On Open' immediatly * showErrorSignal to show error message box from another thread * Fixes #86 Stop uncaught exceptions from silently crashing the app * Fixes #86 Stop uncaught exceptions from silently crashing the app * Fix #114, try to load Start Image on browse & load settings, don't allow a start image to load if hotkeys are not set. * First linting pass Configured VSCode and Markdownlint settings Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper [Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method Hide generated/compiled files SelectRegionWidget width and height as functions Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter * Moved most settings to pyproject.toml and ran autopep8 * Removed mypy and Fixed import-outside-toplevel * Double quotes and pylint complete linting * Configured linting workflow * Async check for updates * Fix crash on LiveSplit open and missing link in error message * Merge * Fixed certificate error and random crash on open when compiled * Using python/typeshed/pull/6492 * PEP8 naming convention * Added build artifact * AutoSplitImage Class and simplified code Simplified and reduced image conversions Reduced duplicated code, especially in settings Build Artifact * Average FPS over all images with all actions * Added badges * Fixed "Select Window" not working for windows with negative coordinates Split screen_region in smaller functions WIP towards #94: No pop-up on loading settings with no capture window Don't stop/reset AutoSplit upon loosing capture window No pop-up on loosing capture window Don't allow selecting desktop. * Ability to recover window Fixed regressions: Fix crash on clising window mid-run Forgot to migrate split_delay to image.delay Removed dead load_pyqt_settings code Fixed dummy groups Pause time from filename not set correctly Setting hotkeys on load * Differentiate "undo/skip split" from "previous/next image" Skip/udo will now actually call command This makes grouping option obsolete as user now has finer control anyway UI is a bit cramped, but that should be resolved with UI revamp Updated README * Make Save Settings more intuitive Don't close if user has cancelled "saving sattings as" Removed more attributes from AutoSplit class Don't update last_successfully_loaded_settings_file_path if load was not successful "Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe When closing app, ue save_settings instead of save_settings_as * Initial UI update for 2.0.0. Add settings window. * Hooked new settings window to actual values (#151) * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group Co-authored-by: Austin <[email protected]> * Image comparison method and default delay time (#135) * hooked new settings window to actual values * Implemented image specific comparison method and default delay time. Closes #26 * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group * Fixed images comparison method defaulting to 0 rather than none Co-authored-by: Austin <[email protected]> * Support hotkeys with modifiers (#136) * hooked new settings window to actual values * Better "seconds remaining" text * Support modifiers the same way LiveSplit does. Closes #34 * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group Co-authored-by: Austin <[email protected]> * Linted pyi files (#137) * hooked new settings window to actual values * Linted pyi files * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group * Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member) * Massively sped up Flake tests Removed 400+kb of type stubs * Centralized qWait typing fix * Autosort imports * Resynced settings Co-authored-by: Austin <[email protected]> * Toml profiles + Python 3.10 (#140) * Typings update * Full setup and configuration update * User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor * Added new Capture Method system for more capture options + utils (#141) * Add D3DShot types from python/typeshed#8652 * New Capture Method system * Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161) * Doc + Setup update * typings update * Warning if AutoSplit is already open + Build number + Splash Screen * Target the right repository/fork * Fix #155 * Actions shortcut and prevent double open window Closes #154 * ImageHash hotfix * Toggle autoreset image + ui adjustments (#164) * merge master into 2.0.0 (#165) * update credits * oops * Toggle autoreset image (#162) * Fix #52 Comparisons with empty masks * Save 'Check For Updates On Open' immediatly * showErrorSignal to show error message box from another thread * Fixes #86 Stop uncaught exceptions from silently crashing the app * Fixes #86 Stop uncaught exceptions from silently crashing the app * Fix #114, try to load Start Image on browse & load settings, don't allow a start image to load if hotkeys are not set. * First linting pass Configured VSCode and Markdownlint settings Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper [Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method Hide generated/compiled files SelectRegionWidget width and height as functions Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter * Moved most settings to pyproject.toml and ran autopep8 * Removed mypy and Fixed import-outside-toplevel * Double quotes and pylint complete linting * Configured linting workflow * Async check for updates * Fix crash on LiveSplit open and missing link in error message * Merge * Fixed certificate error and random crash on open when compiled * Using python/typeshed/pull/6492 * PEP8 naming convention * Added build artifact * AutoSplitImage Class and simplified code Simplified and reduced image conversions Reduced duplicated code, especially in settings Build Artifact * Average FPS over all images with all actions * Added badges * Fixed "Select Window" not working for windows with negative coordinates Split screen_region in smaller functions WIP towards #94: No pop-up on loading settings with no capture window Don't stop/reset AutoSplit upon loosing capture window No pop-up on loosing capture window Don't allow selecting desktop. * Ability to recover window Fixed regressions: Fix crash on clising window mid-run Forgot to migrate split_delay to image.delay Removed dead load_pyqt_settings code Fixed dummy groups Pause time from filename not set correctly Setting hotkeys on load * Differentiate "undo/skip split" from "previous/next image" Skip/udo will now actually call command This makes grouping option obsolete as user now has finer control anyway UI is a bit cramped, but that should be resolved with UI revamp Updated README * Make Save Settings more intuitive Don't close if user has cancelled "saving sattings as" Removed more attributes from AutoSplit class Don't update last_successfully_loaded_settings_file_path if load was not successful "Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe When closing app, ue save_settings instead of save_settings_as * Initial UI update for 2.0.0. Add settings window. * Hooked new settings window to actual values (#151) * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group Co-authored-by: Austin <[email protected]> * Image comparison method and default delay time (#135) * hooked new settings window to actual values * Implemented image specific comparison method and default delay time. Closes #26 * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group * Fixed images comparison method defaulting to 0 rather than none Co-authored-by: Austin <[email protected]> * Support hotkeys with modifiers (#136) * hooked new settings window to actual values * Better "seconds remaining" text * Support modifiers the same way LiveSplit does. Closes #34 * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group Co-authored-by: Austin <[email protected]> * Linted pyi files (#137) * hooked new settings window to actual values * Linted pyi files * Initial UI update for 2.0.0. Add settings window. * hooked new settings window to actual values * Better "seconds remaining" text * Undo split goes to the end of the group * Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member) * Massively sped up Flake tests Removed 400+kb of type stubs * Centralized qWait typing fix * Autosort imports * Resynced settings Co-authored-by: Austin <[email protected]> * Toml profiles + Python 3.10 (#140) * Typings update * Full setup and configuration update * User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor * Added new Capture Method system for more capture options + utils (#141) * Add D3DShot types from python/typeshed#8652 * New Capture Method system * Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161) * Doc + Setup update * typings update * Warning if AutoSplit is already open + Build number + Splash Screen * Target the right repository/fork * Fix #155 * Actions shortcut and prevent double open window Closes #154 * ImageHash hotfix * Toggle autoreset image + ui adjustments Co-authored-by: Austin <[email protected]> * Revert "Toggle autoreset image (#162)" (#163) This reverts commit 9e48c51. Co-authored-by: Samuel T <[email protected]> * test building without --windowed * First round of QA testing fixes (#171) * Added sonarcloud.properties * Remove duplicate DeleteDC & allow errors to show May fix #167 * Rename CaptureMethodInterface to CaptureMethodBase * Added autofix script and faster linting * Disable device probing for now. Fixes #169 * Updated settings widget text and workaround to fix #170 * Bump AUTOSPLIT_VERSION * Next Image even if it's not possible to split Fixes #168 * Fix build * First round of QA testing fixes + build fixes (#172) * back to windowed * Fix #47, updated some configs and types from typeshed (#173) * Updated configs * Updated typings * Updated some code * Fix #47 * Revert mypy stuff * More consistent formatting (#174) * More consistent formatting and types - Added autofixes to the lint script. - Added a quotes autofixer using `unify` - Added a trailing comma checker and autofixer - Applied trailing commas - Ordered requirements alphabetically - Ensure the last version of D3DShot is used (0.1.5, not 0.1.3) - Remove configuration for unused linters (black/prettier/sonarlint) - Updated types from typeshed * Updated virtual camera link * Update types and pylint * Batch fixes (#176) * pyright update * lint-and-build cover more files * Get IDirect3dDevice from LearningModelDevice Closes #175 Co-authored-by: Algomancer <[email protected]> * Ensure we're using the right camera size And not OpenCV's default 640x480 * Fix rounding error in displayed decimal * Revert "back to windowed" This reverts commit 9553271. * Fix highest similarity for start image * Fix split below treshold when image is not valid * Detect gray frames from OBS-Camera Co-authored-by: Algomancer <[email protected]> * Adaptive resizing for masked images (#177) Especially in the case of 1080p or higher, if the non-transparent area of the mask image used for the split is small, resizing the entire image to 320x240 will lose the information inside the mask. One idea to prevent this is to adaptively determine the target size according to the number of nonzero elements in the alpha channel of the split image. At least for the L2 norm and histogram, such a change would not affect performance since they only use information about the mask's interior. Masks are not recommended with pHash anyway. Co-authored-by: zalgo3 <[email protected]> * Bump opencv-python to 4.6 (#178) * Point python_grabber to andreaschiavinato (#179) * Batch of updates and fixes for 2.0.0 (#188) * Point python_grabber to andreaschiavinato * Added summary of histogram * Backport changes from linux branch * Improved pyright and formatters usage * Config updates * Fix links * Disable next/previous while delaying * proper `is_running` variable * Fix loading and clearing of start image * Rename "already_running" to "already_open" * Fix delay intervals * Add support for start image pause time * Default to MediaCapture's d3d * Re-enable buttons after delay * Beta 1 (feature-freeze, bugfixes only) * Updated configs to use Python 3.11 (#180) * Option to build without build number + Adaptive mask fix (#189) * Option to build without build number * Fix repo url from workflow build * Resize mask with image * Pin more dependencies, Speed-up installs and update comments * Add mypy config for optional support. * pin requests and allow pyright warnings (#193) * Fix B028 (#194) * Fixed run_start_time with start image pause loop (#197) Also fixed run_start_time not accounting for the delay in parsing images * Disable Capture device: dropdown when Capture method: is not Video Capture Device (#198) Fix issue with programatically setting capture_device_combobox index * Fix start issue after finishing splits (#199) * Fix start issue after finishing splits - `self.is_running = False` at the end of `__auto_splitter` - Revert moving initialization of some values - Move `self.run_start_time = time()` before parsing images * Update hardcoded references to repo name * Change default capture method to WGA (#200) * Delete example1.6.0.gif * 2.0.0 gif * update gif to 2.0.0 * Update some docs and fix lint issue (#202) * Update docs, comments and typings Add link to dev builds bump beta version Update flake8 checks "fix" typing issue caused by PyQt6 incorrect callable * Slight build improvement * Fix D3DDD issue on hybrid GPU laptops (#205) * Fix D3DDD issue on hybrid gpu laptops 1. Some Desktop Duplication setup was done in advance, even if that method won't be used 2. Hybrid GPU laptops can have issues with D3D Desktop Duplication. The issue and a workaround is now documented * Fixed some blocking typing and linting issues * Fix obs-camera image freezing for a sec when it gives a blank frame (#206) * Linting and typing fixes (#208) * start image behavior @Avasam I believe this is accurate, but let me know if it's not --------- Co-authored-by: Austin <[email protected]> Co-authored-by: Algomancer <[email protected]> Co-authored-by: zalgo3 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By @zalgo3
Especially in the case of 1080p or higher, if the non-transparent area of the mask image used for the split is small, resizing the entire image to 320x240 will lose the information inside the mask. One idea to prevent this is to adaptively determine the target size according to the number of nonzero elements in the alpha channel of the split image. At least for the L2 norm and histogram, such a change would not affect performance since they only use information about the mask's interior. Masks are not recommended with pHash anyway.
Closes #157
This is a good step towards smarter resizing (eventually I'd like to keep aspect ratios, resize width from height independently, only shrink / never grow, and only when necessary)