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

Why the patchembedding defaut img size is not equal to the image size in visualize attention? #261

Open
LWShowTime opened this issue Nov 9, 2023 · 1 comment

Comments

@LWShowTime
Copy link

n visualize_attention.py:

parser.add_argument("--image_size", default=(480, 480), type=int, nargs="+", help="Resize image.")

However, in vision_transformer.py:

dino/vision_transformer.py

Lines 116 to 122 in 7c446df

class PatchEmbed(nn.Module):
""" Image to Patch Embedding
"""
def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768):
super().__init__()
num_patches = (img_size // patch_size) * (img_size // patch_size)
self.img_size = img_size

Will this cause any performance drop?

@LWShowTime
Copy link
Author

LWShowTime commented Nov 9, 2023

I notice in DINO, your team have delete this line from the origin ViT:
assert H == self.img_size[0], f"Input image height ({H}) doesn't match model ({self.img_size[0]}).

@piotr-bojanowski @mathildecaron31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant