Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing legacy model tags #493

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 0 additions & 73 deletions terratorch/models/backbones/prithvi_vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,77 +317,4 @@ def prithvi_eo_v2_600_tl(
return _create_prithvi("prithvi_eo_v2_600_tl", pretrained=pretrained, **dict({"model_bands": bands}, **kwargs))


# TODO: Remove prithvi_vit_tiny and prithvi_vit_100 before version 1.0.
@ TERRATORCH_BACKBONE_REGISTRY.register
def prithvi_vit_tiny(
pretrained: bool = False, # noqa: FBT001, FBT002
bands: list[HLSBands] | None = None,
**kwargs,
) -> PrithviViT:

warnings.warn(f"The model prithvi_vit_tiny was renamed to prithvi_eo_tiny. "
f"prithvi_vit_tiny will be removed in a future version.", FutureWarning)

return prithvi_eo_tiny(pretrained=pretrained, **dict({"model_bands": bands}, **kwargs))


@ TERRATORCH_BACKBONE_REGISTRY.register
def prithvi_vit_100(
pretrained: bool = False, # noqa: FBT001, FBT002
bands: list[HLSBands] | None = None,
**kwargs,
) -> PrithviViT:
warnings.warn("The model prithvi_vit_100 was renamed to prithvi_eo_v1_100. "
"prithvi_vit_100 will be removed in a future version.", FutureWarning)

return prithvi_eo_v1_100(pretrained=pretrained, **dict({"model_bands": bands}, **kwargs))


# TODO: Remove timm_ errors before version v1.0.
@ TERRATORCH_BACKBONE_REGISTRY.register
def timm_prithvi_eo_v1_100(
pretrained: bool = False, # noqa: FBT001, FBT002
bands: list[HLSBands] | None = None,
**kwargs,
) -> None:
raise ValueError("The Prithvi models were moved to the terratorch registry. "
"Please remove the timm_ prefix from the model name.")


@ TERRATORCH_BACKBONE_REGISTRY.register
def timm_prithvi_eo_v2_300(
pretrained: bool = False, # noqa: FBT001, FBT002
bands: list[HLSBands] | None = None,
**kwargs,
) -> None:
raise ValueError("The Prithvi models were moved to the terratorch registry. "
"Please remove the timm_ prefix from the model name.")


@ TERRATORCH_BACKBONE_REGISTRY.register
def timm_prithvi_eo_v2_600(
pretrained: bool = False, # noqa: FBT001, FBT002
bands: list[HLSBands] | None = None,
**kwargs,
) -> None:
raise ValueError("The Prithvi models were moved to the terratorch registry. "
"Please remove the timm_ prefix from the model name.")

@ TERRATORCH_BACKBONE_REGISTRY.register
def timm_prithvi_eo_v2_300_tl(
pretrained: bool = False, # noqa: FBT001, FBT002
bands: list[HLSBands] | None = None,
**kwargs,
) -> None:
raise ValueError("The Prithvi models were moved to the terratorch registry. "
"Please remove the timm_ prefix from the model name.")


@ TERRATORCH_BACKBONE_REGISTRY.register
def timm_prithvi_eo_v2_600_tl(
pretrained: bool = False, # noqa: FBT001, FBT002
bands: list[HLSBands] | None = None,
**kwargs,
) -> None:
raise ValueError("The Prithvi models were moved to the terratorch registry. "
"Please remove the timm_ prefix from the model name.")
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ model:
model_args:
decoder: MLPDecoder
pretrained: false
backbone: prithvi_vit_100
backbone: prithvi_eo_v1_100
decoder_activation: ReLU
backbone_drop_path_rate: 0.3
num_frames: 1
Expand Down