fix: pass img_size to GreenFormer + gitignore .DS_Store

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
cmoyates 2026-03-01 09:46:31 -03:30
parent 9cd800d37b
commit b95c1f9e31
No known key found for this signature in database
GPG Key ID: F65E08480FDC22D2
3 changed files with 6 additions and 3 deletions

3
.gitignore vendored
View File

@ -20,3 +20,6 @@ samples/
# Inference outputs
output/
# OS files
.DS_Store

View File

@ -158,13 +158,13 @@ class CNNRefinerModule(nn.Module):
class GreenFormer(nn.Module):
"""Top-level CorridorKey model: Hiera encoder + dual decoder heads + CNN refiner."""
def __init__(self) -> None:
def __init__(self, img_size: int = IMG_SIZE) -> None:
super().__init__()
self.encoder = timm.create_model(
HIERA_MODEL_NAME,
pretrained=False,
features_only=True,
img_size=IMG_SIZE,
img_size=img_size,
)
self._patch_first_conv()

View File

@ -63,7 +63,7 @@ def main() -> None:
torch.set_grad_enabled(False)
print(f"Building model (img_size={args.img_size})...")
model = GreenFormer()
model = GreenFormer(img_size=args.img_size)
model.eval()
print(f"Loading checkpoint: {args.checkpoint}")