Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Skip register tokens in ExtractPatchFeatures #672

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

nkaenzig
Copy link
Collaborator

@nkaenzig nkaenzig commented Oct 9, 2024

The hibou models from hist.ai use a vit architecture with 4 additional register tokens.

For segmentation tasks, we take the last feature map and reshape it to a 2D patch, so to do so the register tokens need to be skipped. In the current code, we seem to include the register tokens and instead skipping image tokens, which leads to poor performance.

See consep performance before & after this fix:
image

@nkaenzig nkaenzig added the bug Something isn't working label Oct 9, 2024
@nkaenzig nkaenzig self-assigned this Oct 9, 2024
@nkaenzig nkaenzig marked this pull request as ready for review October 9, 2024 08:47
@nkaenzig nkaenzig enabled auto-merge (squash) October 9, 2024 08:47
@nkaenzig nkaenzig changed the title Skip register tokens in ExtractPatchFeatures Fix: Skip register tokens in ExtractPatchFeatures Oct 9, 2024
@nkaenzig nkaenzig merged commit 15a5f33 into main Oct 9, 2024
6 checks passed
@nkaenzig nkaenzig deleted the fix-ignore-remaining-dims branch October 9, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants