Introduction to TerraTorch
TerraTorch is a sophisticated library designed to enhance the process of fine-tuning Geospatial Foundation Models. Built upon two powerful frameworks—PyTorch Lightning and the TorchGeo domain library—TerraTorch stands out for its flexibility and comprehensive functionality tailored specifically for handling geospatial data.
Key Features
TerraTorch provides users with several significant features:
-
Access to Pre-trained Models: TerraTorch allows easy access to a range of pre-trained Geospatial Foundation Models. Some of these include Prithvi, SatMAE, and ScaleMAE. Furthermore, it supports other backbone models available through the timm and SMP packages. For those looking for more specific models, fine-tuned options like the granite-geospatial-biomass model are also available.
-
Versatile Trainers: The library comes equipped with adaptable trainers that cater to various tasks. Whether you're working on image segmentation, classification, or pixel-wise regression, TerraTorch has the tools you need to fine-tune your models effectively.
-
Flexible Configuration: Fine-tuning tasks can be launched via configurable files, allowing users to customize their workflows according to their specific requirements.
Installation Guide
For those looking to install TerraTorch, several options are available:
-
Using Pip:
- Ensure you have pip version 21.8 or higher. If not, upgrade using
python -m pip install --upgrade pip
. - For a stable release, use
pip install terratorch
. - To access the latest version straight from the main branch, use
pip install git+https://github.com/IBM/terratorch.git
.
- Ensure you have pip version 21.8 or higher. If not, upgrade using
-
Using Pipx: For those who prefer isolated environments, install TerraTorch with pipx using
pipx install terratorch
. This approach presents TerraTorch as a CLI tool, ensuring an easy setup without dependency issues. -
Developer Installation:
- Clone the repository and install dependencies with
pip install -r requirements/required.txt -r requirements/dev.txt
. - To install with partial support for Weather Foundation Models, use
pip install -e .[wxc]
, applicable for Python versions 3.11 and above.
- Clone the repository and install dependencies with
For all installations, having GDAL installed on your system is crucial. If it's not set up, using a conda environment with conda install -c conda-forge gdal
is recommended.
Getting Started
To quickly become acquainted with TerraTorch, check out the quick start guide. This resource provides step-by-step instructions and practical insights to help users harness TerraTorch's capabilities efficiently.
Developer Insights
For developers interested in contributing or extending TerraTorch, it's essential to review the architecture overview. This document offers a detailed look into the library’s structure. When contributing, remember to sign your commits using git commit -s -m <message>
to satisfy GitHub DCO checks.
In summary, TerraTorch serves as a robust and flexible framework for anyone working with geospatial models. Its extensive feature set, combined with its user-friendly design, makes it an invaluable tool for both researchers and developers in the geospatial domain.