🆕 Define DeepFeatureExtractor#963
Merged
shaneahmed merged 52 commits intodev-define-engines-abcfrom Dec 5, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev-define-engines-abc #963 +/- ##
==========================================================
+ Coverage 94.85% 95.07% +0.22%
==========================================================
Files 75 77 +2
Lines 9477 9674 +197
Branches 1238 1253 +15
==========================================================
+ Hits 8989 9198 +209
+ Misses 452 440 -12
Partials 36 36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… into dev-define-DeepFeatureExtractor
shaneahmed
commented
Nov 7, 2025
Results are inconsistent as the model is redefined on a different device.
… error is generated.
- SemanticSegmentor Features are not required.
- Labels are intended for calculation of accuracy values or performance in Python codes. - Intended use may not be suitable for cli.
Member
Author
Thanks @measty I have addressed all your comments. I think it is much improved now. Please let me know if you have any further comments. |
shaneahmed
commented
Dec 3, 2025
| toolbox_env.running_on_ci() or not ON_GPU, | ||
| reason="Local test on machine with GPU.", | ||
| ) | ||
| def test_multi_gpu_feature_extraction( |
Member
Author
There was a problem hiding this comment.
@adamshephard Please can you test this? Thanks
measty
requested changes
Dec 5, 2025
Collaborator
measty
left a comment
There was a problem hiding this comment.
Looks much better now, just one last thing to address and then i'm happy to approve
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.
🚀 Summary
This PR introduces a new
DeepFeatureExtractorengine to the TIAToolbox framework, enabling extraction of intermediate CNN feature representations from whole slide images (WSIs) or image patches. These features can be used for downstream tasks such as clustering, visualization, or training other models. The update also includes:✨ Key Features
New Engine:
DeepFeatureExtractortimm.list_models(), including HuggingFace-hosted models.CLI Integration
deep-feature-extractorcommand to TIAToolbox CLI.resnet18,efficientnet_b0, timm-based backbones, etc.).patch_input_shape,stride_shape,input_resolutions).Extended CLI Utilities
--input-resolutions,--output-resolutions(JSON list of dicts).--patch-input-shape,--stride-shape,--scale-factor.--class-dictfor mapping class indices to names.--overwriteand--output-filefor fine-grained control.Unit Tests
CNNBackboneandTimmBackbonemodels.Codebase Integration
DeepFeatureExtractorintiatoolbox.modelsand engine registry.tiatoolbox.cli.__init__.py.torch_cnn_backbone_dict,timm_arch_dict).