Skip to content

Commit

Permalink
skip the first instead of the last remaining dims in `ExtractPatchFea…
Browse files Browse the repository at this point in the history
…tures` (#672)
  • Loading branch information
nkaenzig authored Oct 9, 2024
1 parent 4f1cbc7 commit 15a5f33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/eva/core/models/transforms/extract_patch_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __call__(
height = width = int(math.sqrt(patch_grid))
if height * width != patch_grid:
if self._ignore_remaining_dims:
features = features[:, :, : height * width]
features = features[:, :, -height * width :]
else:
raise ValueError(f"Patch grid size must be a square number {patch_grid}.")
patch_embeddings = features.view(batch_size, hidden_size, height, width)
Expand Down

0 comments on commit 15a5f33

Please sign in to comment.