TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data
Перейти к файлу
Adam J. Stewart 58d05d5950
Remove Codecov annotations from PRs
2021-09-19 11:07:39 -05:00
.github/workflows Required checks must always be run 2021-09-17 14:39:19 -07:00
conf Feature/chesapeake cvpr training (#142) 2021-09-17 16:51:18 -05:00
docs Cleaning up ChesapeakeCVPR (#131) 2021-09-15 11:52:51 -05:00
logo Add favicon to ReadTheDocs 2021-09-08 16:08:04 -05:00
tests CDL: don't re-download dataset if zip files are missing (#138) 2021-09-16 16:22:10 +00:00
torchgeo Feature/chesapeake cvpr training (#142) 2021-09-17 16:51:18 -05: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 Removing some headers 2021-08-31 13:25:05 -05:00
.pre-commit-config.yaml Merge pull request #137 from ashnair1/pre-commit 2021-09-15 15:46:35 -07:00
CODE_OF_CONDUCT.md
LICENSE
README.md Fixed typo 2021-09-10 10:21:16 -07:00
SECURITY.md
SUPPORT.md
environment.yml added einops dependency 2021-09-07 21:59:22 -05:00
pyproject.toml Add models to pydocstyle match_dir (#136) 2021-09-14 15:53:38 +00:00
requirements.txt added einops dependency 2021-09-07 21:59:22 -05:00
setup.cfg added einops dependency 2021-09-07 21:59:22 -05:00
setup.py File permissions? 2021-08-31 13:25:05 -05:00
spack.yaml added einops dependency 2021-09-07 21:59:22 -05:00
test_chesapeakecvpr_models.py Cleaning up ChesapeakeCVPR (#131) 2021-09-15 11:52:51 -05:00
train.py Cleaning up ChesapeakeCVPR (#131) 2021-09-15 11:52:51 -05: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: docs style tests

Installation instructions

Until the first release, you can install an environment compatible with torchgeo with conda, pip, or spack as shown below.

Conda

Note: if you do not have access to a GPU or are running on macOS, replace pytorch-gpu with pytorch-cpu in the environment.yml file.

$ conda config --set channel_priority strict
$ conda env create --file environment.yml
$ conda activate torchgeo

Pip

With Python 3.6 or later:

$ pip install -r requirements.txt

Spack

$ spack env activate .
$ spack install

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]["wind_speed"])

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

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.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.