🎨 Refactor ModelABC to Help Use Default Torch Models#867
Draft
shaneahmed wants to merge 189 commits intodevelopfrom
Draft
🎨 Refactor ModelABC to Help Use Default Torch Models#867shaneahmed wants to merge 189 commits intodevelopfrom
ModelABC to Help Use Default Torch Models#867shaneahmed wants to merge 189 commits intodevelopfrom
Conversation
- Use `pyproject.toml` for `bdist_wheel` configuration
- Improve `Engines` performance and implementation
- Refactor engines_abc.py
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…618) - Moved all ioconfigs to a single file. - Used dataclass to define ioconfig. - Refactor base code from `IOSegmentorConfig` to `ModelIOConfigABC` - Use `ModelIOConfigABC` for `PatchPredictor` instead of `IOSegmentorConfig` --------- Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: John Pocock <John-P@users.noreply.github.com> Co-authored-by: Mark Eastwood <20169086+measty@users.noreply.github.com> Co-authored-by: Mostafa Jahanifar <74412979+mostafajahanifar@users.noreply.github.com> Co-authored-by: Adam Shephard <39619155+adamshephard@users.noreply.github.com>
- Move `WSIStreamDataset`, `PatchDatasetABC` and `WSIPatchDataset` to `dataset_abc.py` --------- Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
# Conflicts: # tests/models/test_feature_extractor.py # tiatoolbox/models/models_abc.py
# Conflicts: # tiatoolbox/cli/common.py # tiatoolbox/cli/nucleus_instance_segment.py # tiatoolbox/cli/patch_predictor.py # tiatoolbox/models/engine/semantic_segmentor.py
* ⚡ Make WSIPatchDataset Pickleable to Support Windows Multithreading (#947) This PR makes the WSIPatchDataset class picklable by delaying the creation of the reader object until the first call to `__getitem__`. This enables the use of multiple loader workers on Windows without errors and provides significant performance improvements. - Delays reader object instantiation to the first `__getitem__` call instead of during initialization - Extracts reader creation logic into a separate `_get_reader` method - Stores image path and mode as instance variables for lazy initialization Speedup for the WSI prediction cell of the patch_prediction example notebook: 2min 48 sec with 0 loader workers -> 1min 13 sec with 4 workers. Note: this PR doesn't have any effect for Linux as the multi-threading already works fine there because Linux multithreading doesn't require things to be pickleable * 🔀 Merge branch develop into dev-engine-abc * 🐛 Fix reader_info read --------- Co-authored-by: Mark Eastwood <20169086+measty@users.noreply.github.com>
# Conflicts: # tiatoolbox/models/dataset/classification.py
# Conflicts: # tests/models/test_patch_predictor.py
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
8 tasks
This file contains hidden or 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
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.
ModelABCto Help Use Default Torch Modelsinfer_batchfromModelABC