kaiko-ai / eva

Evaluation framework for oncology foundation models (FMs)
https://kaiko-ai.github.io/eva/
Apache License 2.0
66 stars 4 forks source link

Add model wrapper to load models from `torch.hub` #720

Closed nkaenzig closed 4 days ago

nkaenzig commented 4 days ago

While most models from torch.hub can be loaded via our existing timm.wrappers, I've observed that models instantiated this way can produce slightly different tensors in the forward pass than when instantiating the model using torch.hub.load, probably related to type castings. We should add a model wrapper that supports loading models using torch.hub.load. While this can be achieved already using the ModelFromFunction wrapper, this doesn't support out_indices which is required for segmentation tasks in eva.vision.