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

Extend/tests #28

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = "terratorch"
version = "0.99.0"
version = "0.99.1"
description = "TerraTorch - A model training toolkit for geospatial tasks"
license = { "text" = "Apache License, Version 2.0" }
readme = "README.md"
Expand Down Expand Up @@ -144,7 +144,7 @@ exclude_lines = [
]

[tool.bumpver]
current_version = "0.99.0"
current_version = "0.99.1"
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
commit_message = "Bump version {old_version} -> {new_version}"
commit = true
Expand Down
10 changes: 10 additions & 0 deletions tests/test_backbones.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import timm
import torch
import importlib

import terratorch # noqa: F401

Expand Down Expand Up @@ -49,7 +50,16 @@ def test_vit_models_accept_multitemporal(model_name, input_224_multitemporal):
backbone = timm.create_model(model_name, pretrained=False, num_frames=NUM_FRAMES)
backbone(input_224_multitemporal)

# Swin IS NOT on HuggingFace
@pytest.mark.parametrize("model_name", ["prithvi_swin_L", "prithvi_swin_B"])
def test_swin_instantiation(model_name):
base_module = "terratorch.models.backbones.prithvi_swin"
module = importlib.import_module(base_module)
model_class = getattr(module, model_name)

model = model_class(pretrained=False, pretrained_bands=[0,1,2,3,4,5,6,7,8,9],
bands=[1,2,3,4,5,6])

Comment on lines +54 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as in #29 , is this test redundant with the timm creation models above? I think they go through the same code paths

#def test_swin_models_accept_non_divisible_by_patch_size(input_386):
# backbone = timm.create_model("prithvi_swin_90_us", pretrained=False, num_frames=NUM_FRAMES)
# backbone(input_386)
Loading