Favicon of TorchGeo

TorchGeo

A Python library for geospatial deep learning with PyTorch, offering satellite imagery datasets, multispectral models and pretrained weights under MIT.

Screenshot of TorchGeo website

TorchGeo is an open source Python library for machine learning researchers and remote sensing specialists working with satellite and aerial imagery. It brings geographic datasets and pretrained models into PyTorch training workflows. The MIT license allows you to use and adapt it for your own projects.

Geographic alignment matters here. TorchGeo preserves coordinate reference systems, spatial boundaries and acquisition metadata, and its samplers select image regions by geographic location. That helps when training data needs to retain its relationship to places on a map. Its image transforms support multispectral data, and models accept different band counts rather than requiring every input to be RGB.

The library includes benchmark datasets for classification, regression, segmentation and object detection, as well as change detection. Examples include EuroSAT for land-cover classification and Inria Aerial Image Labeling for building footprints. PyTorch and torchvision users get familiar interfaces, while Lightning data modules provide defined training, validation and test splits for comparing experiments.

Pretrained weights cover satellite and aerial imagery, with models such as DOFA, Prithvi, SatMAE and Scale-MAE. These give researchers starting points suited to remote sensing data instead of relying only on ImageNet training. Checkpoint definitions record the expected sensors, spectral bands and preprocessing; available weights cover Sentinel-1 radar, Sentinel-2 optical imagery and other sensor data.

Datasets and pretrained weights have their own licenses; the library's MIT terms do not cover every asset it can load.

Similar to TorchGeo