Satellite imagery has its own geometry, statistics, and metadata — it’s a different modality from natural images, not just bigger pictures. TorchGeo adds CRS-aware datasets, spatial samplers, multispectral transforms, and pretrained backbones to PyTorch.
Datasets return tensor dicts, samplers yield geographic windows, models take arbitrary band counts. The six modules below compose the way torchvision does, so most of the API will feel familiar.
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)
Geo-referenced raster & vector datasets with CRS, metadata, and download handling built in.
100+ · benchmark + geospatialSpatially-aware samplers that iterate over geographic extents — random, grid, pre-chipped.
single · + batchedKornia-compatible augmentations for arbitrary band counts. Indices, normalization, geometry.
n-band · multispectral safeSatellite-pretrained backbones & task heads. ResNet, ViT, Swin, DOFA, Prithvi, ScaleMAE.
40+ · pretrained weightsLightning datamodules wrapping splits, transforms, and samplers — one import per benchmark.
ready · to trainLightning trainers for classification, segmentation, regression, change & object detection.
task · modulestorchgeo.datasets.
0.3 m/px aerial · building footprints · 5 cities

Mask R-CNN · 10 classes · 800 scenes
SAR · multispectral · hyperspectral · LiDAR
A single ViT trained on Sentinel-1, Sentinel-2, NAIP, Gaofen, and EnMAP — wavelength-conditioned.
IBM × NASA's masked-autoencoder ViT, fine-tuned for floods, wildfires, and crop classification.
GSD-conditioned MAE — the same backbone reasons across 0.3 m to 30 m without retraining.
MAE pretrained on temporal Sentinel-2 stacks. Strong on land cover and crop-type tasks.
Seasonal-contrast pretraining over a million Sentinel-2 image pairs — first-class baseline.
A 1M-image SSL benchmark — DINO, MoCo, MAE, Data2Vec checkpoints all under one API.
Citations counted from the 2022paper forward (Google Scholar, rounded down). Repo count comes from GitHub’s dependency graph, filtered to non-fork, non-archived geospatial projects across 160 organizations.
Started in 2021 as a Microsoft AI for Good internship project, TorchGeo now operates as an independent, self-governing OSGeo Community Project — MIT-licensed, with contributors across academia, industry, and government. In 2025 the TorchGeo Organization was founded to steward the project. Sponsorships fund maintainer time, model checkpoints, dataset hosting, and workshops.