gmberton commited on
Commit
e54c666
·
1 Parent(s): 13ec015

Fix positional encoding argument order for non-square images

Browse files
Files changed (1) hide show
  1. megaloc_model.py +1 -1
megaloc_model.py CHANGED
@@ -362,7 +362,7 @@ class DINOv2(nn.Module):
362
  x = self.patch_embed(images)
363
  cls_tokens = self.cls_token.expand(B, -1, -1)
364
  x = torch.cat((cls_tokens, x), dim=1)
365
- x = x + self.interpolate_pos_encoding(x, W, H)
366
 
367
  for block in self.blocks:
368
  x = block(x)
 
362
  x = self.patch_embed(images)
363
  cls_tokens = self.cls_token.expand(B, -1, -1)
364
  x = torch.cat((cls_tokens, x), dim=1)
365
+ x = x + self.interpolate_pos_encoding(x, H, W)
366
 
367
  for block in self.blocks:
368
  x = block(x)