Lightweight benchmarking framework for geospatial models
Project description
torchgeo-bench
A lightweight benchmarking framework for evaluating frozen geospatial foundation models on the GeoBench V1 and V2 suites. Plug in any backbone, get KNN-5 / linear-probe accuracy on classification datasets and mIoU on segmentation datasets, with bootstrapped 95% confidence intervals — all configured through Hydra.
- Frozen-backbone evaluation — KNN-5, L-BFGS logistic regression, and linear / conv / FPN / DPT segmentation probes.
- GeoBench V1 + V2 built in — classification and segmentation, RGB or full multispectral / multi-modal stacks.
- Hydra-driven — sweep models, datasets, partitions, image sizes, and bands without code changes.
- Resumable —
resume=trueskips already-computed(dataset, method, model, …)rows. Atomic CSV appends are safe across parallel jobs. - Bring your own model — copy
contrib_template.py, implement_forward_patch_features, and add a one-file Hydra config. See the Stage 1 guide for a full walkthrough, or the Stage 2 guide to contribute the model back upstream.
Installation
pip install torchgeo-bench
For development:
git clone https://github.com/torchgeo/torchgeo-bench
cd torchgeo-bench
uv sync --extra dev
For GPU-accelerated KNN (Linux + CUDA 12 + glibc ≥ 2.28):
pip install 'torchgeo-bench[cuda]'
Requires Python 3.12+. The default (CPU) install runs on Linux, macOS,
and Windows; GPU-accelerated KNN (the [cuda] extra) is Linux-only.
Download a dataset
The runner expects datasets under ./data/. To grab GeoBench V1:
torchgeo-bench download geobench_v1
V2 (classification + segmentation) and torchgeo's EuroSAT downloader work the
same way (torchgeo-bench download geobench_v2, torchgeo-bench download eurosat). See the documentation
for all options.
Run a basic experiment
# Default: random convolutional features (RCF) on every available dataset
torchgeo-bench run
# A single dataset with a pretrained ImageNet ResNet-50
torchgeo-bench run model=timm/resnet50 dataset.names=[m-eurosat]
The default device is cuda:0. On a machine without a working CUDA GPU (or if
a GPU run crashes — see troubleshooting),
fall back to CPU:
torchgeo-bench run dataset.names=[m-eurosat] device=cpu
Results are appended to results/all_results.csv, which ships pre-populated
with reference results — to start from a clean slate, write to your own file
with output=results/my_run.csv. Re-run with resume=true to skip
already-completed rows.
Learn more
- Documentation — full configuration reference, available models, dataset tables, multi-band experiments, evaluation methodology, output schema, dev / release workflow, and troubleshooting.
- AGENTS.md — contributor guide and house style.
Citation
If you use this framework, please cite it (once the torchgeo-bench paper is
available):
@misc{torchgeobench,
title = {torchgeo-bench: A lightweight benchmarking framework for geospatial foundation models},
author = {torchgeo-bench Contributors},
year = {TBD},
note = {Software},
url = {https://github.com/torchgeo/torchgeo-bench}
}
License
MIT.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torchgeo_bench-0.4.0.tar.gz.
File metadata
- Download URL: torchgeo_bench-0.4.0.tar.gz
- Upload date:
- Size: 110.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07efa4a576a57ed0da250c6a53c37279bc75b49a410608f922cdc54778517eba
|
|
| MD5 |
b3a97123f253bbb9aa1bf5a2b7650394
|
|
| BLAKE2b-256 |
bfe8339b8a986090bb1d9145c9751fc8579ac31809319e2447493612dca4efc9
|
Provenance
The following attestation bundles were made for torchgeo_bench-0.4.0.tar.gz:
Publisher:
release.yml on torchgeo/torchgeo-bench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torchgeo_bench-0.4.0.tar.gz -
Subject digest:
07efa4a576a57ed0da250c6a53c37279bc75b49a410608f922cdc54778517eba - Sigstore transparency entry: 2016225690
- Sigstore integration time:
-
Permalink:
torchgeo/torchgeo-bench@e9abc15019529c4b046e1fb16a781b1d540349df -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/torchgeo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e9abc15019529c4b046e1fb16a781b1d540349df -
Trigger Event:
push
-
Statement type:
File details
Details for the file torchgeo_bench-0.4.0-py3-none-any.whl.
File metadata
- Download URL: torchgeo_bench-0.4.0-py3-none-any.whl
- Upload date:
- Size: 182.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e284b4d612689f52e7e45c438015bc742f1e6a56adb9d66b529cf8cbd74b0f7
|
|
| MD5 |
2373b9ec211d5d456f0b04ec8cb42996
|
|
| BLAKE2b-256 |
2b91cec1c809d157714d27ff70a7787e268f5507be9836d07fe949f99d4d7ff3
|
Provenance
The following attestation bundles were made for torchgeo_bench-0.4.0-py3-none-any.whl:
Publisher:
release.yml on torchgeo/torchgeo-bench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torchgeo_bench-0.4.0-py3-none-any.whl -
Subject digest:
7e284b4d612689f52e7e45c438015bc742f1e6a56adb9d66b529cf8cbd74b0f7 - Sigstore transparency entry: 2016226008
- Sigstore integration time:
-
Permalink:
torchgeo/torchgeo-bench@e9abc15019529c4b046e1fb16a781b1d540349df -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/torchgeo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e9abc15019529c4b046e1fb16a781b1d540349df -
Trigger Event:
push
-
Statement type: