Skip to main content

TerraTorch - The geospatial foundation model fine-tuning toolkit

Project description

TerraTorch

huggingface pypi tests MkDocs

PyPI Downloads Conda Downloads

Please, read the contribution guidelines (see Contribution below) if you want to contribute to TerraTorch.

Overview

TerraTorch is a PyTorch domain library based on PyTorch Lightning and the TorchGeo domain library for geospatial data.

Please also try our HPO/NAS tool: Iterate

Disclaimer

TerraTorch provides tools for fine-tuning and using pretrained models. No models are hosted by TerraTorch. TerraTorch only provides the training and inference framework.

User responsibility: It is the sole responsibility of the user to verify that the license of any model they download, fine-tune, or deploy allows their intended use. The TerraTorch maintainers do not provide legal advice and are not liable for any misuse of third-party models.


YouTube Video: Introduction to TerraTorch YouTube

TerraTorch’s main purpose is to provide a flexible fine-tuning framework for Geospatial Foundation Models, which can be interacted with at different abstraction levels. The library provides:

  • Convenient modelling tools:
    • Flexible trainers for Image Segmentation, Classification and Pixel Wise Regression fine-tuning tasks
    • Model factories that allow to easily combine backbones and decoders for different tasks
    • Ready-to-go datasets and datamodules that require only to point to your data with no need of creating new custom classes
    • Launching of fine-tuning tasks through CLI and flexible configuration files, or via jupyter notebooks
  • Easy access to:

Installation

Pip

In order to use the file pyproject.toml it is necessary to guarantee pip>=21.8. If necessary upgrade pip using python -m pip install --upgrade pip.

For a stable point-release, use pip install terratorch==<version>.

To get the most recent version of the branch main, install the library with pip install git+https://github.com/terrastackai/terratorch.git.

Conda

TerraTorch is also available on conda-forge, to install from there do conda install -c conda-forge terratorch.

Pipx

Alternatively, it is possible to install using 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.

Gdal

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 recommend using a conda environment and installing it with conda install -c conda-forge gdal. If you are installing from conda-forge it probably won't be a problem.

Install as a developer

To install as a developer (e.g. to extend the library):

git clone https://github.com/terrastackai/terratorch.git
cd terratorch
pip install -e .[test]

To install terratorch with partial (work in development) support for Weather Foundation Models, pip install -e .[wxc], which currently works just for Python >= 3.11.

Documentation

To get started, check out the quick start guide.

Developers, check out the architecture overview.

TerraTorch: The Geospatial Foundation Models Toolkit on arXiv

Contributing

This project welcomes contributions and suggestions. Ways to contribute or get involved:

You can find more detailed contribution guidelines here.

If you want to meet the GitHub DCO checks, you need to do your commits as below:

git commit -s -m <message>

It will sign the commit with your ID and the check will be met.

Credits

Embed2Scale Embed2Scale. The embedding workflow integration and maintenance in TerraTorch are carried out as part of the Embed2Scale project (Earth Observation & Weather Data Federation with AI Embeddings), funded by the EU’s Horizon Europe programme (Grant Agreement No. 101131841), with additional support from SERI and UKRI.

License

This project is primarily licensed under the Apache License 2.0.

However, some files contain code licensed under the MIT License. These files are explicitly listed in MIT_FILES.txt.

By contributing to this repository, you agree that your contributions will be licensed under the Apache 2.0 License unless otherwise stated.

For more details, see the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terratorch-1.2.7.tar.gz (563.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terratorch-1.2.7-py3-none-any.whl (592.6 kB view details)

Uploaded Python 3

File details

Details for the file terratorch-1.2.7.tar.gz.

File metadata

  • Download URL: terratorch-1.2.7.tar.gz
  • Upload date:
  • Size: 563.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for terratorch-1.2.7.tar.gz
Algorithm Hash digest
SHA256 005a802f1c38989c6971da26f8c6010f3ef42cdb9156a125af1044b760edf4ae
MD5 b144c13d08954967a1c43664f0e3a3cd
BLAKE2b-256 955995af0e871ab978de9d892f038ab12e18883e6f8c21d5de54cd07ad6f21e6

See more details on using hashes here.

File details

Details for the file terratorch-1.2.7-py3-none-any.whl.

File metadata

  • Download URL: terratorch-1.2.7-py3-none-any.whl
  • Upload date:
  • Size: 592.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for terratorch-1.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ed52939a2d1198d0fa2d401c6c9ffbe2cf596eb40b7eabf975954277bd8fb7d0
MD5 5b391fc4b9583748e1bae69ae321eacc
BLAKE2b-256 3389091d6728b94fa830a5903152a4092857fb5e79717d6d70bc7fe549b44db5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page