torchgeo
TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data
Decision gist · record as of 2026-08-14
Yes, if you are working with satellite or geospatial imagery in a PyTorch workflow. The library solves real problems—automatic CRS reprojection, multispectral band alignment, and intelligent patch sampling from large rasters—that would otherwise require substantial custom code. Active maintenance, MIT license, and integration with Lightning make it a solid foundation. The 22 runtime dependencies are heavy but standard for this domain; install time and disk footprint are expected costs. Not necessary if your geospatial work is small-scale or already handled by other tools.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyTorch and torchvision to be installed; torch and torchvision are heavy compiled dependencies that may take time to download and build on some systems.
- Low friction installation with a pure Python wheel.
- The 22 runtime dependencies include heavy ML stacks (torch, torchvision, lightning, kornia, segmentation-models-pytorch) that will pull in substantial compiled code; installation time and disk footprint are non-trivial but standard for PyTorch-based geospatial work.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute TorchGeo with minimal restrictions, including in commercial projects, provided you retain the license notice.
last release 2026-08-14 (0 days) · last repo commit 2026-08-14 · 4,143 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 79,184 downloads/mo, #14,375 on PyPI
Alternatives
Verify before relying
pip install torchgeo
from torchgeo.datasets import Landsat8, CDL
from torchgeo.samplers import RandomPatchSampler
from torch.utils.data import DataLoader
landsat = Landsat8(paths='...')
cdl = CDL(paths='...', download=True)
dataset = landsat & cdl
sampler = RandomPatchSampler(dataset, size=256, length=10000)
loader = DataLoader(dataset, batch_size=128, sampler=sampler)- Whether pre-trained model weights for multispectral channels are included in the package or must be downloaded separately.
- Performance characteristics when working with very large geospatial datasets (e.g., continental-scale imagery).
- Specific remote sensing data formats and coordinate reference systems supported beyond the examples in the description.
What it is and what it does
TorchGeo is a domain library built on PyTorch that bridges machine learning and geospatial data science. It provides curated datasets for satellite imagery (Landsat, Sentinel, and others), samplers that intelligently extract patches from large geographic regions, and pre-trained models adapted for multispectral remote sensing tasks. The library automatically handles the complexity of geospatial work—reprojecting data into matching coordinate reference systems, aligning different satellite sources with different spectral bands, and composing datasets through set operations (union and intersection) based on geographic coverage.
The package targets two audiences: ML practitioners who want to work with satellite and earth observation data without wrestling with geospatial coordinate systems, and remote sensing experts exploring deep learning solutions. It includes both large-scale geospatial datasets (where you sample patches from continental-scale imagery) and benchmark datasets with pre-labeled examples for tasks like object detection, semantic segmentation, and change detection. All datasets integrate seamlessly with PyTorch data loaders and Lightning training pipelines.
Use it for
- Train semantic segmentation models on Landsat or Sentinel satellite imagery with automatic CRS alignment and band selection.
- Build object detection systems on high-resolution aerial imagery using the VHR-10 benchmark dataset.
- Combine multispectral satellite data from different sensors (e.g., Landsat 7 and 8) into a single training dataset.
- Sample random geographic patches from continental-scale raster data like the Cropland Data Layer for efficient batch training.
- Transfer-learn from pre-trained models adapted for multispectral channels beyond standard RGB imagery.
- Prototype change detection or land-use classification pipelines on real remote sensing data with minimal data wrangling.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are working with satellite or geospatial imagery in a PyTorch workflow.
The library solves real problems—automatic CRS reprojection, multispectral band alignment, and intelligent patch sampling from large rasters—that would otherwise require substantial custom code. Active maintenance, MIT license, and integration with Lightning make it a solid foundation. The 22 runtime dependencies are heavy but standard for this domain; install time and disk footprint are expected costs. Not necessary if your geospatial work is small-scale or already handled by other tools.
Install
torchgeo on PyPI
Before you install
Low friction installation with a pure Python wheel. The 22 runtime dependencies include heavy ML stacks (torch, torchvision, lightning, kornia, segmentation-models-pytorch) that will pull in substantial compiled code; installation time and disk footprint are non-trivial but standard for PyTorch-based geospatial work. Actively maintained as of 2026-08-14.
Requires PyTorch and torchvision to be installed; torch and torchvision are heavy compiled dependencies that may take time to download and build on some systems.
License in practice
MIT license is permissive; you can use, modify, and distribute TorchGeo with minimal restrictions, including in commercial projects, provided you retain the license notice.
Quickstart
pip install torchgeo
from torchgeo.datasets import Landsat8, CDL
from torchgeo.samplers import RandomPatchSampler
from torch.utils.data import DataLoader
landsat = Landsat8(paths='...')
cdl = CDL(paths='...', download=True)
dataset = landsat & cdl
sampler = RandomPatchSampler(dataset, size=256, length=10000)
loader = DataLoader(dataset, batch_size=128, sampler=sampler)
Verify before relying
- Whether pre-trained model weights for multispectral channels are included in the package or must be downloaded separately.
- Performance characteristics when working with very large geospatial datasets (e.g., continental-scale imagery).
- Specific remote sensing data formats and coordinate reference systems supported beyond the examples in the description.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.12 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 22 packageseinopsgeopandasjsonargparsekornialightlylightningmatplotlibnumpypandaspillowpyogriopyprojrasteriorequestssegmentation-models-pytorchshapelytimmtorchtorchmetricstorchvisiontqdmtyping-extensions |
| Maintenance | Actively maintained 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 79,184 / month, #14,375 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: GIS |
Evidence: torchgeo-0.10.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “geospatial deep learning pytorch”
- torchgeoTorchGeo provides PyTorch datasets, samplers, transforms, and…
- pytorchThis package is a redirect or placeholder; the actual PyTorch library…
- fastaifastai is a deep learning library that provides high-level APIs for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also torchvision · torchxrayvision · torchtext · owslib · earthengine-api · geemap · datacube · sentinelhub · torchrl · pytorch-forecasting