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.
Metadata
Release files for torchgeo-bench 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| torchgeo_bench-0.4.0.tar.gz | 110.5 kB | With provenance | Details for torchgeo_bench-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| torchgeo_bench-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for torchgeo_bench-0.4.0-py3-none-any.whl |
Total release size: 293.2 kB
Release files / torchgeo_bench-0.4.0.tar.gz
| Download URL | torchgeo_bench-0.4.0.tar.gz |
|---|---|
| Size | 110.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07efa4a576a57ed0da250c6a53c37279bc75b49a410608f922cdc54778517eba
|
|
BLAKE2b-256 checksum How to use checksums |
bfe8339b8a986090bb1d9145c9751fc8579ac31809319e2447493612dca4efc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.
Transparency logRelease files / torchgeo_bench-0.4.0-py3-none-any.whl
| Download URL | torchgeo_bench-0.4.0-py3-none-any.whl |
|---|---|
| Size | 182.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e284b4d612689f52e7e45c438015bc742f1e6a56adb9d66b529cf8cbd74b0f7
|
|
BLAKE2b-256 checksum How to use checksums |
2b91cec1c809d157714d27ff70a7787e268f5507be9836d07fe949f99d4d7ff3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.
Transparency logSecurity for torchgeo-bench 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for torchgeo_bench-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.