Skip to main content

TorchGeo: datasets, transforms, and models for geospatial data

Project description

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: style tests

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torchgeo-0.1.1.tar.gz (95.0 kB view details)

Uploaded Source

Built Distribution

torchgeo-0.1.1-py3-none-any.whl (142.5 kB view details)

Uploaded Python 3

File details

Details for the file torchgeo-0.1.1.tar.gz.

File metadata

  • Download URL: torchgeo-0.1.1.tar.gz
  • Upload date:
  • Size: 95.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for torchgeo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6e28132f75e9d8cb3a3a0e8b443aba3cde26c8f3140b9426139ee6e8f8058b26
MD5 96a99aa7f22c9fab0d270b5d5e3131cb
BLAKE2b-256 3ff882af74b91aff2491addcc803331c6d2dc3ea502717dccc93f9ca0858f5ea

See more details on using hashes here.

File details

Details for the file torchgeo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: torchgeo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 142.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for torchgeo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 acbd8e419150344fbecb827571103162a91b01e2b3ce22e52f0792f0d204a1db
MD5 e37499a0603f5e83f5785c7cea4a3fb6
BLAKE2b-256 a46bdcf09528876dea0649ded3d6de10a26640dc40ed5ec2baa1587d49dc52a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page