TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data
Перейти к файлу
Adam J. Stewart 6bf591fa04
Add favicon to ReadTheDocs
2021-09-08 16:08:04 -05:00
.github/workflows Report coverage 2021-09-03 16:03:55 -05:00
conf Add trainer for NAIP + Chesapeake 2021-09-03 14:18:50 -05:00
docs Add favicon to ReadTheDocs 2021-09-08 16:08:04 -05:00
logo Add favicon to ReadTheDocs 2021-09-08 16:08:04 -05:00
tests updated unit tests 2021-09-07 21:59:22 -05:00
torchgeo remove debug statement from FCSiamDiff 2021-09-07 21:59:22 -05:00
.codecov.yml Suppress codecov comments on PRs 2021-09-04 17:17:31 -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
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
Makefile Add license header to all files 2021-08-31 13:25:05 -05:00
README.md Add codecov badge 2021-09-03 16:10:20 -05: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
environment.yml added einops dependency 2021-09-07 21:59:22 -05:00
pyproject.toml Removing some headers 2021-08-31 13:25:05 -05: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
train.py Add trainer for NAIP + Chesapeake 2021-09-03 14:18:50 -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.trainders 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.