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

Docs/pipx #29

Merged
merged 6 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ In order to use th file `pyproject.toml` it is necessary to guarantee `pip>=21.8
For a stable point-release, use `pip install terratorch`.
If you prefer to get the most recent version of the main branch, install the library with `pip install git+https://github.com/IBM/terratorch.git`.

Another alternative is to install using [pipx](https://github.com/pypa/pipx) via `pipx install terratorch`, which creates an isolated environment and allows the user to run the application as
a common CLI tool, with no need of installing dependencies or activating environments.

TerraTorch requires gdal to be installed, which can be quite a complex process. If you don't have GDAL set up on your system, we reccomend using a conda environment and installing it with `conda install -c conda-forge gdal`.

To install as a developer (e.g. to extend the library) clone this repo, install dependencies using `pip install -r requirements.txt` and run `pip install -e .`
Expand Down
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])

#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