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: docs 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.0.tar.gz (94.5 kB view details)

Uploaded Source

Built Distribution

torchgeo-0.1.0-py3-none-any.whl (142.2 kB view details)

Uploaded Python 3

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

Hashes for torchgeo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44eb3cf10ab2ac63ff95e92fcd3807096bac3dcb9bdfe15a8edac9d440d2f323
MD5 7f8b758effbcd6a2ab468d249f09c4bd
BLAKE2b-256 a67c287027faaef8fc2231a06ca42afb631a42665cfa5914af7dd12fdc119d44

See more details on using hashes here.

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

Hashes for torchgeo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 584b438770793ce266ca58e22f1fd9e42567870a2a57aebb5b7c0f979fbc0f38
MD5 975f61820ef78ae43499781086d3033d
BLAKE2b-256 fd532afcebd8907debae24c0f05afc9b72fb6b16d79a1f32d539ebb1184236cf

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