You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be useful to integrate pre-trained foundation models from other labs into tiatoolbox.models.architecture.vanilla.py.
Currently, the _get_architecture() function allows the use of models from torchvision.models.
But another function _get_timm_architecture() could be made to incorporate foundation models which are available from timm with weights on HuggingFace Hub. All the models from time that I've used require users to sign the licence agreement with the authors, so the licencing question seems to be solved itself since there is no way users will get access to the model weights just through Tiatoolbox without getting the access request approved by the authors first.
What I Did
To add them myself, I copied de definition of CNNBackbone changing
removed global average pooling because given a batch of images, these pathology foundation models come ready to output a feature vector of size (batch_size, embedding_size)
Description
I think it would be useful to integrate pre-trained foundation models from other labs into
tiatoolbox.models.architecture.vanilla.py
.Currently, the
_get_architecture()
function allows the use of models fromtorchvision.models
.But another function
_get_timm_architecture()
could be made to incorporate foundation models which are available fromtimm
with weights on HuggingFace Hub. All the models fromtime
that I've used require users to sign the licence agreement with the authors, so the licencing question seems to be solved itself since there is no way users will get access to the model weights just through Tiatoolbox without getting the access request approved by the authors first.What I Did
To add them myself, I copied de definition of CNNBackbone changing
self.feat_extract = _get_timm_architecture(backbone)
(batch_size, embedding_size)
tiatoolbox/tiatoolbox/models/architecture/vanilla.py
Lines 176 to 270 in 015652c
Suggestion
Would you be interested in adding this functionality? If yes, I can make a pull request.
The text was updated successfully, but these errors were encountered: