TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data
Перейти к файлу
Isaac Corley 1a49cfffbe update tests 2021-09-28 12:43:27 -07:00
.github/workflows Reduce number of files listing deps (#154) 2021-09-22 09:41:00 -05:00
conf Feature/chesapeake cvpr training (#142) 2021-09-17 16:51:18 -05:00
docs SpaceNet 2 (#155) 2021-09-28 10:55:56 -05:00
logo Add favicon to ReadTheDocs 2021-09-08 16:08:04 -05:00
tests update tests 2021-09-28 12:43:27 -07:00
torchgeo refactor to inherit VisionClassificationDataset 2021-09-28 12:43:27 -07: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 Add dataset/sampler benchmarking script (#115) 2021-09-22 09:47:25 -05:00
.pre-commit-config.yaml Merge pull request #137 from ashnair1/pre-commit 2021-09-15 15:46:35 -07: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 Move contribution guide to documentation 2021-09-22 09:20:58 -07: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 Add dataset/sampler benchmarking script (#115) 2021-09-22 09:47:25 -05:00
environment.yml Reduce number of files listing deps (#154) 2021-09-22 09:41:00 -05:00
pyproject.toml Add models to pydocstyle match_dir (#136) 2021-09-14 15:53:38 +00:00
run_benchmarks_experiments.py Add dataset/sampler benchmarking script (#115) 2021-09-22 09:47:25 -05:00
setup.cfg Reduce number of files listing deps (#154) 2021-09-22 09:41:00 -05:00
setup.py File permissions? 2021-08-31 13:25:05 -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

The recommended way to install TorchGeo is with pip:

$ pip install git+https://github.com/microsoft/torchgeo.git

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

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.