fix: pass img_size to GreenFormer + gitignore .DS_Store
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9cd800d37b
commit
b95c1f9e31
3
.gitignore
vendored
3
.gitignore
vendored
@ -20,3 +20,6 @@ samples/
|
||||
|
||||
# Inference outputs
|
||||
output/
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
|
||||
@ -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()
|
||||
|
||||
|
||||
@ -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}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user