torchgeo/terratorch

A Python toolkit for fine-tuning Geospatial Foundation Models (GFMs).

What it solves

TerraTorch is a toolkit designed to simplify the fine-tuning and deployment of Geospatial Foundation Models. It removes the need to write custom classes for every new dataset or model combination, providing a standardized framework for tasks like image segmentation, classification, and pixel-wise regression on satellite and earth observation data.

How it works

Built on PyTorch Lightning and TorchGeo, TerraTorch provides a flexible framework that allows users to combine various pre-trained backbones (such as Prithvi, TerraMind, and SatMAE) with different decoders (from libraries like SMP and mmsegmentation). It offers ready-to-use datasets and datamodules, and allows users to launch fine-tuning tasks via a command-line interface (CLI), configuration files, or Jupyter notebooks.

Who it’s for

This library is intended for researchers and developers working with geospatial AI, specifically those looking to integrate and fine-tune large-scale pre-trained models for earth observation tasks.

Highlights

  • Extensive Model Support: Easy access to a wide range of open-source geospatial backbones including Prithvi, Clay, and Satlas.
  • ** modelled tools**: Flexible trainers for segmentation, classification, and regression tasks.
  • Integrated Data Handling: Direct access to all GEO-Bench and TorchGeo datasets and datamodules.
  • Modular Architecture: Ability to easily swap backbones and decoders using model factories.
  • Optional Extensions: Support for PEFT (Parameter-Efficient Fine-Tuning), VLLM, and specialized weather foundation models.