TorchGeo provides CRS-aware datasets and samplers, multispectral transforms, and pretrained weights for satellite and aerial imagery. Its interfaces compose with PyTorch and Lightning. TorchGeo, TorchGeo-Bench, and TerraTorch are projects of the independent TorchGeo Organization.
Stewart et al. TorchGeo: Deep Learning with Geospatial Data. ACM SIGSPATIAL 2022. doi:10.1145/3557915.3560953
Datasets return tensor dicts, samplers yield geographic windows, and models accept arbitrary band counts. The interfaces follow familiar PyTorch and torchvision conventions.
A Sentinel-2-pretrained ResNet-18 fine-tuned on EuroSAT. The sampler yields windows in the dataset's native CRS; the dataloader is a stock torch.utils.data.DataLoader.
# Fresh interpreter to a fine-tuned Sentinel-2 ResNet-18.from torchgeo.datamodules import EuroSATDataModulefrom torchgeo.models import ResNet18_Weightsfrom torchgeo.trainers import ClassificationTaskfrom lightning.pytorch import Trainerdm = EuroSATDataModule(root="./data", batch_size=64, download=True)task = ClassificationTask(model="resnet18", weights=ResNet18_Weights.SENTINEL2_ALL_MOCO,in_channels=13, num_classes=10,)Trainer(max_epochs=50, accelerator="gpu").fit(task, datamodule=dm)
Founded at Microsoft AI for Good in 2021, TorchGeo is now an independent OSGeo Project. The TorchGeo Organization governs TorchGeo, TorchGeo-Bench, and TerraTorch in public. Sponsorships fund maintainer time, model checkpoints, dataset hosting, and workshops.
torchgeo.datasets.Dataset classes preserve coordinate reference systems, spatial bounds, and acquisition metadata while exposing standard PyTorch dataset interfaces.

0.3 m aerial imagery · building footprints · five cities

Mask R-CNN · 10 classes · 800 scenes
Checkpoint definitions record the expected sensors, bands, and preprocessing so weights can be loaded without discarding input metadata.
| Model | Input | Pretraining and architecture | Sensor domain |
|---|---|---|---|
DOFA | Any · 1–13 ch | Wavelength-conditioned ViT pretrained on Sentinel-1, Sentinel-2, NAIP, Gaofen, and EnMAP. | Multi-sensor |
Prithvi | HLS · 6 ch | IBM × NASA's masked-autoencoder ViT, fine-tuned for floods, wildfires, and crop classification. | HLS L30/S30 |
Scale-MAE | RGB · 3 ch | Ground-sample-distance-conditioned masked autoencoder for imagery from 0.3 m to 30 m. | Aerial / VHR |
SatMAE | S2 · 13 ch | Masked autoencoder pretrained on temporal Sentinel-2 stacks. | Sentinel-2 |
SeCo | S2 · 13 ch | Seasonal-contrast pretraining over one million Sentinel-2 image pairs. | Sentinel-2 |
SSL4EO | S1 + S2 · 15 ch | DINO, MoCo, MAE, and Data2Vec checkpoints trained on one million Sentinel-1 and Sentinel-2 images. | SAR + optical |
| Institution | Papers |
|---|---|
| Technical University of Munich | 8 |
| IBM Research | 3 |
| University of Freiburg | 3 |
| K. N. Toosi University of Technology | 3 |
| Centre National de la Recherche Scientifique | 3 |
| Politecnico di Torino | 3 |
| Samara National Research University | 3 |
| IBM Research - Tokyo | 2 |