Repository navigation
✨ Add training - #1178
✨ Add training#1178measty wants to merge 20 commits into
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| try: | ||
| self.sample_slide_indices, self.sample_bounds = self._build_patch_index() | ||
| finally: | ||
| self.close() |
| ) | ||
| ) | ||
| finally: | ||
| self.close() |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1178 +/- ##
==========================================
Coverage 99.91% 99.92%
==========================================
Files 116 129 +13
Lines 13578 16489 +2911
Branches 1624 2155 +531
==========================================
+ Hits 13567 16476 +2909
Misses 5 5
- Partials 6 8 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| failure = RuntimeError("read failed") | ||
| with pytest.raises(RuntimeError, match="read failed"), reader: | ||
| raise failure | ||
| handle.close.assert_called_once_with() |
…toolbox into add-training-draft
…toolbox into add-training-draft
…alytics/tiatoolbox into add-training-draft
…alytics/tiatoolbox into add-training-draft
| """Return number of available pairs.""" | ||
| return len(self.images) | ||
|
|
||
| def __getitem__(self: PatchMaskPairDataset, index: int) -> dict: |
…toolbox into add-training-draft
|
Please can you rename the files to 14, 15, & 16? |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2026-11-13T13:35:57Z can we add a hyperlink to 05 notebook? |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2026-11-13T13:35:57Z Line #22. "https://tiatoolbox.dcs.warwick.ac.uk/datasets/kather100k-validation-sample.zip", Are these available on huggingface? If yes, can we use that link instead? |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2026-11-13T13:35:58Z Line #30. "https://tiatoolbox.dcs.warwick.ac.uk/sample_wsis/TCGA-3L-AA1B-01Z-00-DX1.8923A151-A690-40B7-9E5A-FCBEDFC2394F.svs", same here, if this is available via huggingface.
I was also thinking if we should have an API to download TCGA images directly from TCGA? |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2026-11-13T13:35:59Z Line #1. fig, axes = plt.subplots(len(class_names), 4, figsize=(10, 14)) Can we print something above the figures to show what's being displayed? Figure title etc? |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2026-11-13T13:36:00Z Line #16. persistent_workers=True, Move the comment "Persistent workers avoid restarting worker processes every epoch." on line 16 if possible. |
|
View / edit / reply to this conversation on ReviewNB shaneahmed commented on 2026-11-13T13:36:01Z It would be good to add a markdown cell to explain what this cell is doing. |
This PR adds a training API and example notebooks to TIAToolbox.
It's main design choices are:
A good example of why this can be so powerful is shown in this code snippet for training a multi-headed segmentation model:
We have defined, with relatively little code, a quite complex set of targets for a multi-head segmentation model such as KongNet, utilizing the AnnotationStore query functionality via the
where=f'props["class"] == "{label}"'to limit the annotations read be each head to only the annotations of the appropriate class for that head, and using the 3 stacked target builders to create a 3-channel target for each head that combines mask, boundary and centroid supervison. We have also created a convenient dataset that will construct image-target pairs of that form directly from the annotation stores.A typical training workflow for a new task would look like:
Some common cases are illustrated in the 3 example notebooks:
Most parts are fairly easy to replace with custom versions (for example custom targets or transforms) if needed.
More detailed documentation can be found in the training.rst docs page.
Currently a draft - it is a large PR so testing it out a bit would be useful.