From 15a5f33e67f0c7d77551b186057583b70f321e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20K=C3=A4nzig?= <36882833+nkaenzig@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:31:58 +0200 Subject: [PATCH] skip the first instead of the last remaining dims in `ExtractPatchFeatures` (#672) --- src/eva/core/models/transforms/extract_patch_features.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eva/core/models/transforms/extract_patch_features.py b/src/eva/core/models/transforms/extract_patch_features.py index 1b3ce00c..0a87d27d 100644 --- a/src/eva/core/models/transforms/extract_patch_features.py +++ b/src/eva/core/models/transforms/extract_patch_features.py @@ -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)