📝 Update 05-patch-prediction notebook for the New API#977
📝 Update 05-patch-prediction notebook for the New API#977shaneahmed merged 21 commits intodev-define-engines-abcfrom
05-patch-prediction notebook for the New API#977Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev-define-engines-abc #977 +/- ##
=======================================================
Coverage 95.30% 95.30%
=======================================================
Files 79 79
Lines 9945 9955 +10
Branches 1280 1280
=======================================================
+ Hits 9478 9488 +10
Misses 431 431
Partials 36 36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…es model attributes regardless of DataParallel wrapping
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
05-patch-prediction notebook to Make it Compatible with the New Engines API
05-patch-prediction notebook to Make it Compatible with the New Engines API05-patch-prediction notebook for the New API
| """ | ||
| for path in files: | ||
| notebook = json.loads(path.read_text()) | ||
| with Path.open(path, encoding="utf-8", errors="ignore") as f: |
There was a problem hiding this comment.
| with Path.open(path, encoding="utf-8", errors="ignore") as f: | |
| notebook = json.loads(path.read_text()) |
| for path in files: | ||
| notebook = json.loads(path.read_text()) | ||
| with Path.open(path, encoding="utf-8", errors="ignore") as f: | ||
| notebook = json.load(f) |
There was a problem hiding this comment.
| notebook = json.load(f) |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2025-12-19T11:40:55Z zarr_output = zarr.open("path/to/zarr", mode="r")
predictions = {}
for key in zarr_output: predictions[key]=da.from_zarr(zarr_output[key})
_ = predictor.save_predictions(predictions, output_type="annotation_store") |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2025-12-19T11:40:55Z Line #2. tiatoolbox visualize --slides ./tmp/slides --overlays ./tmp/wsi_predictions_annotationstore/ |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2025-12-19T11:45:19Z Add class_dict for visualization |
# Conflicts: # tiatoolbox/models/engine/patch_predictor.py
for more information, see https://pre-commit.ci
Summary
This PR updates the patch‑prediction example to align with the new
PatchPredictorengine and fixes a long‑standing issue inEngineABCrelated to model‑attribute retrieval when usingDataParallel.What’s Changed
🔧 Example Notebook Updates
examples/05-patch-prediction.ipynbto use the newPatchPredictorengine API.🐛 EngineABC Bug Fix
EngineABCwhere model attributes were incorrectly retrieved from aDataParallelwrapper._get_model_attr()to safely unwrap the underlying model when needed.Why This Matters
Testing