ViCCo-Group / thingsvision

Python package for extracting representations from state-of-the-art computer vision models
https://vicco-group.github.io/thingsvision/
MIT License
157 stars 21 forks source link

Fixed utils bug in DINO models #153

Closed jonasd4 closed 1 year ago

jonasd4 commented 1 year ago

When using the DINO ViT models from torch hub, an error occurred when the project directory also contained a utils module. This PR instantiates the vit models independently and then loads only the state dict from torch hub.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 67.39% and project coverage change: -0.81% :warning:

Comparison is base (62a80b7) 74.24% compared to head (ce6dd8b) 73.43%. Report is 3 commits behind head on master.

:exclamation: Current head ce6dd8b differs from pull request most recent head 1b18a9e. Consider uploading reports for the commit 1b18a9e to get more accurate results

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #153 +/- ## ========================================== - Coverage 74.24% 73.43% -0.81% ========================================== Files 28 30 +2 Lines 1324 1551 +227 Branches 194 220 +26 ========================================== + Hits 983 1139 +156 - Misses 280 347 +67 - Partials 61 65 +4 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `73.43% <67.39%> (-0.81%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ViCCo-Group#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/ViCCo-Group/thingsvision/pull/153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ViCCo-Group) | Coverage Δ | | |---|---|---| | [thingsvision/core/extraction/extractors.py](https://app.codecov.io/gh/ViCCo-Group/thingsvision/pull/153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ViCCo-Group#diff-dGhpbmdzdmlzaW9uL2NvcmUvZXh0cmFjdGlvbi9leHRyYWN0b3JzLnB5) | `71.42% <64.70%> (-1.79%)` | :arrow_down: | | [...ingsvision/utils/models/dino/vision\_transformer.py](https://app.codecov.io/gh/ViCCo-Group/thingsvision/pull/153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ViCCo-Group#diff-dGhpbmdzdmlzaW9uL3V0aWxzL21vZGVscy9kaW5vL3Zpc2lvbl90cmFuc2Zvcm1lci5weQ==) | `65.28% <65.28%> (ø)` | | | [thingsvision/utils/models/dino/utils.py](https://app.codecov.io/gh/ViCCo-Group/thingsvision/pull/153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ViCCo-Group#diff-dGhpbmdzdmlzaW9uL3V0aWxzL21vZGVscy9kaW5vL3V0aWxzLnB5) | `90.00% <90.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/ViCCo-Group/thingsvision/pull/153/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ViCCo-Group)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.