TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data
Перейти к файлу
isaac 3cc63def02
BigEarthNet Trainers (#211)
* add additional bigearthnet test data for train/val/test split

* update bigearthnet dataset length test

* add MultiLabelClassificationTask

* add BigEarthNet trainer and datamodule

* add bigearthnet and multilabelclassificationtask tests

* mypy and format

* add estimated band min/max values for normalization

* softmax outputs to correctly compute metrics

* update min/max stats for 100k samples

* organize imports in torchgeo.trainers.__init__.py

* clean up fixtures in test_tasks.py

* added bigearthnet to train.py

* format

* move fixtures into class methods

* consolidate bigearthnet fixtures

* refactor tasks tests

* add scope=class

* style/mypy fixes

* mypy fixes
2021-11-02 10:45:38 -05:00
.github/workflows Remove Kornia master install inside Github Actions (#203) 2021-10-22 16:10:37 -05:00
conf BigEarthNet Trainers (#211) 2021-11-02 10:45:38 -05:00
docs Refactoring: RegressionTask trainer (#215) 2021-11-01 12:53:09 -05:00
experiments black: skip magic trailing comma 2021-10-26 16:26:58 -05:00
logo Add favicon to ReadTheDocs 2021-09-08 16:08:04 -05:00
tests BigEarthNet Trainers (#211) 2021-11-02 10:45:38 -05:00
torchgeo BigEarthNet Trainers (#211) 2021-11-02 10:45:38 -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 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 TropicalCyclone dataset: use target for sample key (#213) 2021-10-30 16:35:52 -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
benchmark.py black: skip magic trailing comma 2021-10-26 16:26:58 -05:00
environment.yml Indices Transforms (#127) 2021-09-28 17:04:56 -05:00
pyproject.toml Add models to pydocstyle match_dir (#136) 2021-09-14 15:53:38 +00:00
setup.cfg Removing duplicate kornia in setup.cfg 2021-09-29 23:19:45 +00:00
setup.py File permissions? 2021-08-31 13:25:05 -05:00
train.py BigEarthNet Trainers (#211) 2021-11-02 10:45:38 -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]["target"])

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.