TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data
Перейти к файлу
Adam J. Stewart c2b56148cd
Use valid sphinx build API
2021-12-19 16:58:13 -06:00
.github/workflows Indices Tutorial Refactor (#308) 2021-12-19 16:29:12 -06:00
conf Simplify tests a bit 2021-11-07 20:14:20 -06:00
docs Use valid sphinx build API 2021-12-19 16:58:13 -06:00
experiments Trainers: split tasks into separate files, add SemanticSegmentationTask (#224) 2021-11-06 23:57:40 -05:00
logo Add favicon to ReadTheDocs 2021-09-08 16:08:04 -05:00
tests Transform tests: min Kornia version, filter warnings (#306) 2021-12-19 15:05:14 -06:00
torchgeo Style and test fixes 2021-12-19 13:29:38 -06:00
.codecov.yml Remove Codecov annotations from PRs 2021-09-19 11:07:39 -05:00
.flake8 Removing some headers 2021-08-31 13:25:05 -05:00
.gitattributes Removing some headers 2021-08-31 13:25:05 -05:00
.gitignore Ignore PDF figures 2021-10-09 11:58:19 -05:00
.pre-commit-config.yaml black: skip magic trailing comma 2021-10-26 16:26:58 -05:00
.readthedocs.yaml Reduce number of files listing deps (#154) 2021-09-22 09:41:00 -05:00
CODE_OF_CONDUCT.md Add Microsoft open-source template 2021-05-21 11:35:58 -05:00
LICENSE Add Microsoft open-source template 2021-05-21 11:35:58 -05:00
README.md Remove sphinx CI test (#292) 2021-12-19 11:14:17 -06:00
SECURITY.md Add Microsoft open-source template 2021-05-21 11:35:58 -05:00
SUPPORT.md Add Microsoft open-source template 2021-05-21 11:35:58 -05:00
benchmark.py Style and test fixes 2021-12-19 13:29:38 -06:00
environment.yml Replace pytorch-gpu with pytorch in environment.yml (#295) 2021-12-19 11:05:35 -06:00
pyproject.toml Transform tests: min Kornia version, filter warnings (#306) 2021-12-19 15:05:14 -06:00
setup.cfg Rework list of required dependencies (#287) 2021-12-19 11:12:48 -06:00
setup.py File permissions? 2021-08-31 13:25:05 -05:00
train.py Adding RESISC45 trainer with augmentations (#225) 2021-11-07 05:17:57 +00:00

README.md

TorchGeo

TorchGeo is a PyTorch domain library, similar to torchvision, that provides datasets, transforms, samplers, and pre-trained models specific to geospatial data.

The goal of this library is to make it simple:

  1. for machine learning experts to use geospatial data in their workflows, and
  2. for remote sensing experts to use their data in machine learning workflows.

See our installation instructions, documentation, and examples to learn how to use torchgeo.

External links: docs codecov

Tests: style tests

Installation instructions

The recommended way to install TorchGeo is with pip:

$ pip install torchgeo

For conda and spack installation instructions, see the documentation.

Documentation

You can find the documentation for torchgeo on ReadTheDocs.

Example usage

The following sections give basic examples of what you can do with torchgeo. For more examples, check out our tutorials.

Train and test models using our PyTorch Lightning based training script

We provide a script, train.py for training models using a subset of the datasets. We do this with the PyTorch Lightning LightningModules and LightningDataModules implemented under the torchgeo.trainers namespace. The train.py script is configurable via the command line and/or via YAML configuration files. See the conf/ directory for example configuration files that can be customized for different training runs.

$ python train.py config_file=conf/landcoverai.yaml

Download and use the Tropical Cyclone Wind Estimation Competition dataset

This dataset is from a competition hosted by Driven Data in collaboration with Radiant Earth. See here for more information.

Using this dataset in torchgeo is as simple as importing and instantiating the appropriate class.

import torchgeo.datasets

dataset = torchgeo.datasets.TropicalCycloneWindEstimation(split="train", download=True)
print(dataset[0]["image"].shape)
print(dataset[0]["label"])

Contributing

This project welcomes contributions and suggestions. If you would like to submit a pull request, see our Contribution Guide for more information.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.