torchgeo
Use for TorchGeo geospatial deep learning work: datasets, samplers, data modules, transforms, pre-trained models, Lightning tasks, and contribution/testing workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- torchgeo
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use for TorchGeo geospatial deep learning work: datasets, samplers, data modules, transforms, pre-trained models, Lightning tasks, and contribution/testing workflows.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/backend-verification-plan.md2.5 KB
- 参考文档references/repo-provenance.md1.8 KB
- 参考文档references/repo-routing-metadata.json323 B
- 参考文档references/troubleshooting.md3.2 KB
- 脚本scripts/minimal_geodataset_smoke.py1.8 KB
- 脚本scripts/probe_torchgeo_install.py1.9 KB
03 SKILL.md 正文
TorchGeo
Use this repo skill when working with the torchgeo Python package, a PyTorch domain library for geospatial and remote-sensing machine learning. The skill is grounded in the TorchGeo repository at commit 51a30d67f28794090f88a59b91deeadf91de1878 and is intended for later Researcher sessions; do not assume the original checkout is available.
Route by task
- Dataset composition,
GeoDataset/NonGeoDataset, raster/vector IO, sample dictionaries, collate functions, patch samplers, ROI/TOI selection, or fake dataset fixtures: read datasets-and-samplers. - Lightning
DataModuleusage,torchgeoCLI/JSONArgParse configs, task classes for classification, segmentation, detection, regression, self-supervised learning, or batch augmentation handoff: read datamodules-and-tasks. - Pre-trained models, weight enums,
get_model,get_weight,list_models, timm/SMP integration, spectral indices, SAR/color/spatial/temporal transforms, or optional model dependencies: read models-and-transforms. - Adding or modifying TorchGeo code, dataset tests, docs tables, style/type checks, fake data generation, or project conventions: read contribution-and-testing.
High-signal operating facts
- TorchGeo has two dataset families:
GeoDatasetinstances are indexed by spatiotemporal slices and can be composed with&for intersection and|for union.NonGeoDatasetinstances behave like torchvision-style benchmark datasets and are indexed by integer sample id.
- Dataset samples are dictionaries. Common keys are
image,mask,label,bbox_xyxy, metadata keys such ascrs/bounds, and task-specific keys. Do not assume a fixed schema without reading the dataset class or test fixture. - Use
stack_samplesfor geospatial sample dictionaries and task-specific collate helpers such as detection collation where the datamodule/test uses them. - Patch samplers yield
GeoSlicewindows;RandomPatchSampleris for stochastic training chips andGrid/GriddedPatchSamplerstyle samplers are for deterministic tiling/evaluation. - The
torchgeocommand line entry point is backed bytorchgeo.main:mainand Lightning/JSONArgParse. Prefer a config file for reproducible task/datamodule/trainer runs. - Most practical workflows require geospatial dependencies (
rasterio,pyproj,shapely,geopandas) and ML dependencies (torch,torchvision,lightning,kornia,timm,segmentation-models-pytorch). Optional dataset/model extras are not always installed. - Avoid downloads/network in routine tests unless the test is explicitly marked slow. The repository uses small generated fake fixtures under
tests/data/<dataset>/.
Bundled references and scripts
- Repo provenance
- Troubleshooting
- Backend and environment plan
- Router metadata
scripts/probe_torchgeo_install.py: inspect an installed TorchGeo environment without downloading data.scripts/minimal_geodataset_smoke.py: create a tiny in-memoryGeoDataset/sampler smoke check when dependencies are installed.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).