torchGeo Release v0.7.0

 
torchGeo is a PyTorch domain library designed to make it simple for machine learning experts to work with geospatial data, providing datasets, samplers, transforms, and pre-trained models specific to geospatial data.

torchgeo_models
    Model Diagram titled Panopticon

 

Highlights of this release

torchGeo 0.7 adds 26 new pre-trained model weights, 33 new datasets, and more powerful trainers, encompassing 7 months of hard work by 20 contributors from around the world.

torchGeo has a growing collection of Earth observation foundation models, including 94 weights from 13 papers:

  • GASSL (@kayush95 et al., 2020): Uses spatially aligned images over time to construct temporal positive pairs and a novel geo-location pretext task. Great if you are working with high-resolution RGB data such as Planet or Maxar.
  • SeCo (@oscmansan et al., 2021): Introduces the idea of seasonal contrast, using spatially aligned images over time to force the model to learn features invariant to seasonal augmentations, invariant to synthetic augmentations, and invariant to both.
  • SSL4EO-S12 (@wangyi111 et al., 2022): A spiritual successor to SeCo, with models for Sentinel-1/2 data pretrained using MoCo, DINO, and MAE new.
  • Satlas (@favyen2 et al., 2022): A collection of Swin V2 models pretrained on a staggering amount of Sentinel-2 and NAIP data, with support for single-image and multiple-image time series. Sentinel-1 and Landsat models were later released as well.
  • Scale-MAE (@cjrd et al., 2022): The first foundation model to explicitly support RGB images with a wide range of spatial resolutions.
  • SSL4EO-L (@adamjstewart et al., 2023): The first foundation models pretrained on Landsat imagery, including Landsat 4–5 (TM), Landsat 7 (ETM+), and Landsat 8–9 (OLI/TIRS).
  • DeCUR (@wangyi111 et al., 2023): Uses a novel multi-modal SSL strategy to promote learning a common representation while also preserving unique sensor-specific information.
  • FG-MAE (@wangyi111 et al., 2023): new A feature-guided MAE model, pretrained to reconstruct features from histograms of gradients (HOG) and normalized difference indices (NDVI, NDWI, NDBI).
  • CROMA (@antofuller et al., 2023): new Combines contrastive learning and reconstruction loss to learn rich representations of MSI and SAR data.
  • DOFA (@xiong-zhitong et al., 2024): Introduced the idea of dynamically generating the patch embedding layer of a shared multimodal encoder, allowing a single model weight to support SAR, RGB, MSI, and HSI data. Great for working with multimodal data fusion, flexible channel combinations, or new satellites which don’t yet have pretrained models.
  • SoftCon (@wangyi111 et al., 2024): new Combines a novel multi-label soft contrastive learning with land cover semantics and cross-domain continual pretraining, allowing the model to integrate knowledge from existing computer vision foundation models like DINO (ResNet) and DINOv2 (ViTs). Great if you need efficient small models for SAR/MSI.
  • Panopticon (@LeWaldm et al., 2025):new (model architecture pictured above) Extends DINOv2 with cross attention over channels, additional metadata in the patch embeddings, and spectrally-continual pretraining. Great if you want the same features as DOFA but with even better performance, especially on SAR and HSI data, and on “non-standard” sensors.
  • Copernicus-FM (@wangyi111 et al., 2025): new Combines the spectral hypernetwork introduced in DOFA with a new language hypernetwork and additional metadata. Great if you want to combine image data with non-spectral data, such as DEMs, LU/LC, and AQ data, and supports variable image dimensions thanks to FlexiViT.

100+ built-in data loaders!

torchGeo now boasts a whopping 126 built-in data loaders. Shoutout to the following folks who have worked tirelessly to make these datasets more accessible for the ML/EO community: @adamjstewart @nilsleh @isaaccorley @calebrob6 @ashnair1 @wangyi111 @GeorgeHuber @yichiac @iejMac etc. See the above figure for a breakdown of how many datasets each of these people have packaged.

In order to build the above foundation models, torchGeo includes an increasing number of large pretraining datasets:

  • BigEarthNet (@gencersumbul et al., 2019): Including BEN v1 and v2 new, consisting of 590K Sentinel-2 patches with a multi-label classification task.
  • Million-AID (@IenLong et al., 2020): 1M RGB aerial images from Google Earth Engine, including both multi-label and mutli-class classification tasks.
  • SeCo (@oscmansan et al., 2021): 1M images and 70B pixels from Sentinel-2 imagery, with a novel Gaussian sampling technique around urban centers with greater data diversity.
  • SSL4EO-S12 (@wangyi111 et al., 2022): 3M images and 140B pixels from Sentinel-1 GRD, Sentinel-2 TOA, and Sentinel-2 SR. Extends the SeCo sampling strategy to avoid overlapping images. new Now with automatic download support and additional metadata.
  • SatlasPretrain (@favyen2 et al., 2022): new Over 10M images and 17T pixels from Landsat, NAIP, and Sentinel-1/2 imagery. Also includes 302M supervised labels for 127 categories and 7 label types.
  • HySpecNet-11k (@m.fuchs et al., 2023): new 11k hyperspectral images from the EnMAP satellite.
  • SSL4EO-L (@adamjstewart et al., 2023): 5M images and 348B pixels from Landsat 4–5 (TM), Landsat 7 (ETM+), and Landsat 8–9 (OLI/TIRS). Extends the SSL4EO-S12 sampling strategy to avoid nodata pixels, and includes both TOA and SR imagery, composing the largest ever Landsat dataset. new Now with additional metadata.
  • SkyScript (@wangzhecheng et al., 2023): new 5.2M images from NAIP, orthophotos, Planet SkySat, Sentinel-2, and Landsat 8–9, with corresponding text descriptions for VLM training.
  • MMEarth (@vishalned et al., 2024): new 6M image patches and 120B pixels from over 1.2M locations, including Sentinel-1/2, Aster DEM, and ERA5 data. Includes both image-level and pixel-level classification labels.
  • Copernicus-Pretrain (@wangyi111 et al., 2025): (new, pictured below) 19M image patches and 920B pixels from Sentinel-1/2/3/5P and Copernicus GLO-30 DEM data. Extends SSL4EO-S12 for the entire Copernicus family of satellites.

torchgeo_bench

 
We are also expanding our collection of benchmark suites to evaluate these new foundation models on a variety of downstream tasks:

  • SpaceNet (@avanetten et al., 2018): A challenge with 8 (and growing) datasets for instance segmentation tasks in building segmentation and road network mapping, with > 11M building footprints and ~20K km of road labels.
  • Copernicus-Bench (@wangyi111 et al., 2025): new A collection of 15 downstream tasks for classification, pixel-wise regression, semantic segmentation, and change detection. Includes Level-1 preprocessing (e.g., cloud detection), Level-2 base applications (e.g., land cover classification), and Level-3 specialized applications (e.g., air quality estimation). Covers Sentinel-1/2/3/5P sensors, and includes the first curated benchmark datasets for Sentinel-3/5P.

More powerful trainers

VHR-10 Instance Segmentation

torchGeo now includes 10 trainers that make it easy to train models for a wide variety of tasks:

  • Classification: including binary new, multi-class, and multi-label classification
  • Regression: including image-level and pixel-level regression
  • Semantic segmentation: including binary new, multi-class, and multi-label new semantic segmentation
  • Instance segmentation: (example predictions pictured above) for RGB, SAR, MSI, and HSI data
  • Object detection: new now with support for SAR, MSI, and HSI data
  • BYOL: Bootstrap Your Own Latent SSL method
  • MoCo: Momentum Contrast, including v1, v2, and v3
  • SimCLR: Simple framework for Contrastive Learning of visual Representations, including v1 and v2
  • I/O Bench: For benchmarking torchGeo I/O performance

In particular, instance segmentation was @ariannasole23‘s course project, so you have her to thank for that. Additionally, trainers now properly denormalize images before plotting, resulting in correct “true color” plots in tensorboard.

Backwards-incompatible changes

torchGeo has graduated from alpha to beta development status (#2578). As a result, major backwards-incompatible changes will coincide with a 1 minor release deprecation before complete removal whenever possible from now on.

  • MultiLabelClassificationTask is deprecated, use ClassificationTask(task='multilabel', num_labels=...) instead (#2219)
  • torchgeo.transforms.AugmentationSequential is deprecated, use kornia.augmentation.AugmentationSequential instead (#1978, #2147, #2396)
  • torchgeo.datamodules.utils.AugPipe was removed (#1978)
  • Many objection detection datasets and tasks changed sample keys to match Kornia (#1978, #2513)
  • Channel dimension was squeezed out of many masks for compatibility with torchmetrics (#2147)
  • dofa_huge_patch16_224 was renamed to dofa_huge_patch14_224 (#2627)
  • SENTINEL1_ALL_* weights are deprecated, use SENTINEL1_GRD_* instead (#2677)
  • ignore parameter was moved to a class attribute in BaseTask (#2317)
  • Removed IDTReeS.plot_las, use matplotlib instead (#2428)

Dependencies

New dependencies

Removed dependencies

Changes to existing dependencies

  • Python: drop support for Python 3.10 (#2559)
  • Python: add Python 3.13 tests (#2547)
  • Fiona: v1.8.22+ is now required (#2559)
  • H5py: v3.8+ is now required (#2559)
  • Kornia: v0.7.4+ is now required (#2147)
  • Lightning: v2.5.0 is not compatible (#2489)
  • Matplotlib: v3.6+ is now required (#2559)
  • Numpy: v1.23.2+ is now required (#2559)
  • OpenCV: v4.5.5+ is now required (#2559)
  • Pandas: v1.5+ is now required (#2559)
  • Pillow: v9.2+ is now required (#2559)
  • Pyproj: v3.4+ is now required (#2559)
  • Rasterio: v1.3.3+ is now required, v1.4.0–1.4.2 is not compatible (#2442, #2559)
  • Ruff: v0.9+ is now required (#2423, #2512)
  • Scikit-image: v0.20+ is now required (#2559)
  • Scipy: v1.9.2+ is now required (#2559)
  • SMP: v0.3.3+ is now required (#2513)
  • Shapely: v1.8.5+ is now required (#2559)
  • Timm: v0.9.2+ is now required (#2513)
  • Torch: v2+ is now required (#2559)
  • Torchmetrics: v1.2+ is now required (#2513)
  • Torchvision: v0.15.1+ is now required (#2559)

Datamodules

New datamodules

Changes to existing datamodules

  • Fix support for large mini-batches in datamodules previously using RandomNCrop (#2682)
  • I/O Bench: fix automatic downloads (#2577)

Datasets

New datasets

Changes to existing datasets

  • Many objection detection datasets changed sample keys to match Kornia (#1978, #2513)
  • BioMassters: rehost on HF (#2676)
  • Digital Typhoon: fix MD5 checksum (#2587)
  • ETCI 2021: fix file list when ‘vv’ in directory name (#2532)
  • EuroCrops: fix handling of Nones in labels (#2499)
  • IDTReeS: removed support for plotting lidar point cloud (#2428)
  • Landsat 7: fix default bands (#2542)
  • ReforesTree: skip images with missing mappings (#2668)
  • ReforesTree: fix image and mask dtype (#2642)
  • SSL4EO-L: add additional metadata (#2535)
  • SSL4EO-S12: add additional metadata (#2533)
  • SSL4EO-S12: add automatic download support (#2616)
  • VHR-10: fix plotting (#2603)
  • ZueriCrop: rehost on HF (#2522)

Changes to existing base classes

  • GeoDataset: all datasets now support non-square pixel resolutions (#2601, #2701)
  • RasterDataset: assert valid bands (#2555)

Models

New model architectures

New model weights

Changes to existing models

  • Timm models now support features_only=True (#2659, #2687)
  • DOFA: save hyperparameters as class attributes (#2346)
  • DOFA: fix inconsistent patch size in huge model (#2627)

Samplers

  • Add ability to set random sampler generator seed (#2309, #2316)

Trainers

New trainers

  • Instance segmentation (#2513)

Changes to existing trainers

  • All trainers now denormalize images before plotting, resulting in correct “true color” plots in tensorboard (#2560)
  • Classification: add support for binary, multiclass, and multilabel classification (#2219)
  • Classification: MultiLabelClassificationTask is now deprecated (#2219)
  • Object Detection: add support for non-RGB imagery (SAR, MSI, HSI) (#2602)
  • Semantic Segmentation: add support for binary, multiclass, and multilabel semantic segmentation (#2219, #2690)

Changes to trainer base classes

  • Fix load_from_checkpoint to load a pretrained model (#2317)
  • Ignore ignore when saving hyperparameters (#2317)

Transforms

  • AugmentationSequential is now deprecated (#2396)

Documentation

Changes to API docs

  • SpaceNet is now properly documented as a benchmark suite
  • Fix license for RESISC45 and VHR-10
  • SatlasPretrain: fix table hyperlink

Changes to user docs

  • Update list of related libraries (#2691)
  • Add GeoAI to related libraries list (#2675)
  • Add geobench to related libraries list (#2665)
  • Add OTBTF to related libraries list (#2666)
  • Fix file-specific test coverage (#2540)

New tutorials

  • Earthquake detection (#2647)
  • Custom semantic segmentation trainer (#2588)

Changes to existing tutorials

  • Customization: fix broken hyperlink (#2549)
  • Trainers: document where checkpoints are saved (#2658)
  • Trainers: document how to get the best model (#2658)
  • Various typo fixes (#2566)

CI

  • Faster model testing (#2687)
  • Codecov: move configuration file to subdirectory (#2361)
  • Do not cancel in-progress jobs on main branch (#2638)
  • Ignore prettier reformat in git blame (#2299)

Contributors

@adamjstewart released this 05 Apr 19:46
This release is thanks to the following contributors:
contribs
 
@adamjstewart
@ando-shah
@ariannasole23
@ashnair1
@burakekim
@calebrob6
@DarthReca
@dcodrut
@giswqs
@isaaccorley
@japanj
@lccol
@LeWaldm
@lns-lns
@mdchuc
@nilsleh
@remicres
@rijuld
@sfalkena
@wangyi111
 

OSGeo Sponsors


View all sponsors