Skip to content

Conversation

a1247418
Copy link
Collaborator

Made model_parameters in TorchvisionExtractor a dict instead of a tuple of dict. Previously, extract_cls_token did not work for torchvision models, as line 36 in torch.py would prevent the creation of the extract_cls_token attribute when a tuple was passed as model_parameters from TorchvisionExtractor.

@LukasMut LukasMut requested review from LukasMut and jonasd4 March 15, 2024 12:03
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.24%. Comparing base (107d317) to head (5913fdb).
Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #157   +/-   ##
=======================================
  Coverage   73.24%   73.24%           
=======================================
  Files          30       30           
  Lines        1555     1555           
  Branches      222      222           
=======================================
  Hits         1139     1139           
  Misses        349      349           
  Partials       67       67           
Flag Coverage Δ
unittests 73.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LukasMut LukasMut added the cleanup Deprecate or refactor code label Mar 18, 2024
@LukasMut
Copy link
Collaborator

LukasMut commented Mar 18, 2024

@a1247418 LGTM. Could you add a test for one of the ImageNet-trained ViTs (from PyTorch) to this file where the CLS token is extracted, similar to how we do it for DINO? Then we can quickly check whether this workaround fixes the problem that you addressed.

Added a test for ViT-B16 from torchvision, using class token extraction.
@LukasMut LukasMut enabled auto-merge March 18, 2024 12:17
@LukasMut LukasMut merged commit 4d2a333 into ViCCo-Group:master Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Deprecate or refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants