from torchgeo.datasets import EuroSAT
from torchgeo.samplers import RandomGeoSampler
from torchgeo.models import ResNet18_Weights, resnet18
dataset = EuroSAT(root="./data", download=True)
sampler = RandomGeoSampler(dataset, size=256, length=1000)
weights = ResNet18_Weights.SENTINEL2_ALL_MOCO
transforms = weights.transforms()
model = resnet18(weights=weights)PyTorch domain library for remote sensing
Geospatial deep learning, without geospatial glue code.
TorchGeo gives researchers and engineers CRS-aware datasets, spatial samplers, multispectral transforms, and pretrained models for satellite and aerial imagery.
pip install torchgeoMIT license.
Library surface
Core pieces, arranged the way PyTorch users expect.
TorchGeo stays close to standard PyTorch ergonomics while handling the spatial rules that ordinary vision libraries ignore.
Datasets
Geo-referenced loaders
Raster and vector benchmarks with coordinates, metadata, and domain-specific conventions already handled.
Samplers
Spatially correct sampling
Patch extraction and region-aware iteration that respect extent, scale, and geographic boundaries.
Transforms
Multispectral augmentation
Kornia-compatible transforms for arbitrary band counts, not just RGB assumptions carried over from natural images.
Models
Remote sensing priors
Satellite-pretrained backbones and task-ready components that fit directly into PyTorch training loops.
Design principles
Solid, research-oriented, and easier to trust at a glance.
The site should feel closer to a strong scientific software project than a startup landing page. Clear claims. Clear entry points. Enough polish to feel current.
Research-friendly defaults
Clear APIs, reproducible dataset wrappers, and a narrow learning curve for teams already fluent in PyTorch.
Built around Earth observation
Coordinate reference systems, tiling, geospatial metadata, and multi-band imagery treated as first-class concerns.
Modern, not over-designed
Documentation, examples, and library surface arranged for fast orientation instead of startup-style visual noise.
Workflow
From raw raster to trained model.
The path is simple, but the underlying geospatial details are not. TorchGeo carries them for you.
Load
Open satellite or aerial benchmarks with spatial metadata preserved.
Sample
Generate geographic tiles and train-validation splits that match the study area.
Transform
Apply augmentation and preprocessing across multispectral tensors, not just three channels.
Train
Fine-tune pretrained models or build new ones inside familiar PyTorch workflows.
Examples
Imagery and tasks already in the library ecosystem.
Existing benchmarks and example workflows make the project legible for both first-time users and experienced remote sensing groups.



Start here
Install TorchGeo and move straight to the data pipeline.
Documentation, tutorials, paper, and source code all in one place.
pip install torchgeoOpen documentation