torchgeo/README.md

86 строки
4.6 KiB
Markdown
Исходник Обычный вид История

<img src="https://raw.githubusercontent.com/microsoft/torchgeo/main/logo/logo-color.svg" width="400" alt="TorchGeo"/>
2021-05-21 05:40:24 +03:00
2021-09-02 23:41:20 +03:00
TorchGeo is a [PyTorch](https://pytorch.org/) domain library, similar to [torchvision](https://pytorch.org/vision), that provides datasets, transforms, samplers, and pre-trained models specific to geospatial data.
2021-08-31 23:34:13 +03:00
2021-09-02 23:41:20 +03:00
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.
2021-08-31 23:34:13 +03:00
See our [installation instructions](#installation-instructions), [documentation](#documentation), and [examples](#example-usage) to learn how to use torchgeo.
2021-07-05 01:03:27 +03:00
2021-09-03 00:10:45 +03:00
External links:
[![docs](https://readthedocs.org/projects/torchgeo/badge/?version=latest)](https://torchgeo.readthedocs.io/en/latest/?badge=latest)
2021-09-04 00:10:20 +03:00
[![codecov](https://codecov.io/gh/microsoft/torchgeo/branch/main/graph/badge.svg?token=oa3Z3PMVOg)](https://codecov.io/gh/microsoft/torchgeo)
2021-11-08 07:59:15 +03:00
[![pypi](https://badge.fury.io/py/torchgeo.svg)](https://pypi.org/project/torchgeo/)
2021-11-16 23:53:06 +03:00
[![conda](https://anaconda.org/conda-forge/torchgeo/badges/version.svg)](https://anaconda.org/conda-forge/torchgeo)
[![spack](https://img.shields.io/spack/v/py-torchgeo)](https://spack.readthedocs.io/en/latest/package_list.html#py-torchgeo)
2021-09-03 00:10:45 +03:00
Tests:
2021-07-05 01:29:51 +03:00
[![docs](https://github.com/microsoft/torchgeo/actions/workflows/docs.yaml/badge.svg)](https://github.com/microsoft/torchgeo/actions/workflows/docs.yaml)
[![style](https://github.com/microsoft/torchgeo/actions/workflows/style.yaml/badge.svg)](https://github.com/microsoft/torchgeo/actions/workflows/style.yaml)
[![tests](https://github.com/microsoft/torchgeo/actions/workflows/tests.yaml/badge.svg)](https://github.com/microsoft/torchgeo/actions/workflows/tests.yaml)
2021-05-21 05:40:24 +03:00
2021-08-31 23:34:13 +03:00
## Installation instructions
The recommended way to install TorchGeo is with [pip](https://pip.pypa.io/):
2021-09-02 23:41:20 +03:00
```console
$ pip install torchgeo
```
For [conda](https://docs.conda.io/) and [spack](https://spack.io/) installation instructions, see the [documentation](https://torchgeo.readthedocs.io/en/latest/user/installation.html).
2021-08-31 23:34:13 +03:00
## Documentation
2021-09-03 00:10:45 +03:00
You can find the documentation for torchgeo on [ReadTheDocs](https://torchgeo.readthedocs.io).
2021-08-31 23:34:13 +03:00
## Example usage
2021-09-03 00:10:45 +03:00
The following sections give basic examples of what you can do with torchgeo. For more examples, check out our [tutorials](https://torchgeo.readthedocs.io/en/latest/tutorials/getting_started.html).
2021-08-31 23:34:13 +03:00
### Train and test models using our PyTorch Lightning based training script
2021-09-10 20:21:16 +03:00
We provide a script, `train.py` for training models using a subset of the datasets. We do this with the PyTorch Lightning `LightningModule`s and `LightningDataModule`s implemented under the `torchgeo.trainers` namespace.
2021-08-31 23:51:37 +03:00
The `train.py` script is configurable via the command line and/or via YAML configuration files. See the [conf/](conf/) directory for example configuration files that can be customized for different training runs.
2021-09-02 23:41:20 +03:00
```console
$ python train.py config_file=conf/landcoverai.yaml
2021-06-25 00:49:31 +03:00
```
2021-08-31 23:34:13 +03:00
### Download and use the Tropical Cyclone Wind Estimation Competition dataset
2021-08-31 23:51:37 +03:00
This dataset is from a competition hosted by [Driven Data](https://www.drivendata.org/) in collaboration with [Radiant Earth](https://www.radiant.earth/). See [here](https://www.drivendata.org/competitions/72/predict-wind-speeds/) for more information.
2021-08-31 23:34:13 +03:00
2021-08-31 23:51:37 +03:00
Using this dataset in torchgeo is as simple as importing and instantiating the appropriate class.
```python
import torchgeo.datasets
2021-08-31 23:34:13 +03:00
2021-08-31 23:51:37 +03:00
dataset = torchgeo.datasets.TropicalCycloneWindEstimation(split="train", download=True)
print(dataset[0]["image"].shape)
print(dataset[0]["label"])
2021-08-31 23:34:13 +03:00
```
2021-07-08 03:16:06 +03:00
2021-11-18 07:13:31 +03:00
## Citation
2021-11-18 07:26:20 +03:00
If you use this software in your work, please cite [our paper](https://arxiv.org/abs/2111.08872):
```
@article{Stewart_TorchGeo_deep_learning_2021,
author = {Stewart, Adam J. and Robinson, Caleb and Corley, Isaac A. and Ortiz, Anthony and Lavista Ferres, Juan M. and Banerjee, Arindam},
journal = {arXiv preprint arXiv:2111.08872},
month = {11},
title = {{TorchGeo: deep learning with geospatial data}},
url = {https://github.com/microsoft/torchgeo},
year = {2021}
2021-11-18 07:26:20 +03:00
}
```
2021-11-18 07:13:31 +03:00
2021-05-21 19:35:58 +03:00
## Contributing
This project welcomes contributions and suggestions. If you would like to submit a pull request, see our [Contribution Guide](https://torchgeo.readthedocs.io/en/latest/user/contributing.html) for more information.
2021-05-21 19:35:58 +03:00
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.