TorchGeo: datasets, transforms, and models for geospatial data
Project description
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:
- for machine learning experts to use geospatial data in their workflows, and
- 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.
Installation instructions
The recommended way to install TorchGeo is with pip:
$ pip install torchgeo
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 LightningModule
s and LightningDataModule
s 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]["label"])
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file torchgeo-0.1.0.tar.gz
.
File metadata
- Download URL: torchgeo-0.1.0.tar.gz
- Upload date:
- Size: 94.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44eb3cf10ab2ac63ff95e92fcd3807096bac3dcb9bdfe15a8edac9d440d2f323 |
|
MD5 | 7f8b758effbcd6a2ab468d249f09c4bd |
|
BLAKE2b-256 | a67c287027faaef8fc2231a06ca42afb631a42665cfa5914af7dd12fdc119d44 |
File details
Details for the file torchgeo-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: torchgeo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 142.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 584b438770793ce266ca58e22f1fd9e42567870a2a57aebb5b7c0f979fbc0f38 |
|
MD5 | 975f61820ef78ae43499781086d3033d |
|
BLAKE2b-256 | fd532afcebd8907debae24c0f05afc9b72fb6b16d79a1f32d539ebb1184236cf |