-
Notifications
You must be signed in to change notification settings - Fork 100
⚡ Improve Engine
Performance and Implementation
#578
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
base: develop
Are you sure you want to change the base?
Conversation
- Use `pyproject.toml` for `bdist_wheel` configuration
- Improve `Engines` performance and implementation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #578 +/- ##
===========================================
- Coverage 99.09% 91.19% -7.90%
===========================================
Files 71 73 +2
Lines 9161 9374 +213
Branches 1196 1230 +34
===========================================
- Hits 9078 8549 -529
- Misses 59 792 +733
- Partials 24 33 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Refactor engines_abc.py
Engines
Performance and ImplementationEngine
Performance and Implementation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…917) * ♻️ Use `input_resolutions` instead of resolution - Use `input_resolutions` instead of resolution to make engines outputs compatible with ioconfig. - Uses input resolution as a list of dictionaries on units and resolution. * ♻️ Use `input_resolutions` instead of resolution - Use `input_resolutions` instead of resolution to make engines outputs compatible with ioconfig. - Uses input resolution as a list of dictionaries on units and resolution. * ✅ Add test to cli.
# Conflicts: # tiatoolbox/models/engine/patch_predictor.py
for more information, see https://pre-commit.ci
# Conflicts: # tiatoolbox/utils/misc.py
# 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
Engines
performance and implementationmypy
Type Checks forcli/common.py
PatchPredictor
Engine based onEngineABC
return_probabilities
option to Paramsmerge_predictions
option inPatchPredictor
engine.post_process_cache_mode
which allows running the algorithm onWSI
infer_wsi
for WSI inferencesave_wsi_output
as this is not required after post processing.merge_predictions
and fixes docstring in EngineABCRunParamscompile_model
is now moved to EngineABC init_calculate_scale_factor
class_dict
definition._get_zarr_array
is now a public functionget_zarr_array
inmisc
patch_predictions_as_annotations
runs the loop onpatch_coords
instead ofclass_probs