Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: reorganize tutorial hierarchy #2439

Merged
merged 7 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ torchgeo
user/glossary
user/alternatives

.. toctree::
:maxdepth: 2
:caption: Tutorials

tutorials/getting_started
tutorials/basic_usage
tutorials/case_studies
tutorials/customization

.. toctree::
:maxdepth: 2
:caption: Package Reference
Expand All @@ -24,23 +33,6 @@ torchgeo
api/trainers
api/transforms

.. toctree::
:maxdepth: 1
:caption: Tutorials

tutorials/getting_started
tutorials/pytorch
tutorials/geospatial
tutorials/torchgeo
tutorials/contribute_non_geo_dataset
tutorials/custom_raster_dataset
tutorials/contribute_datamodule
tutorials/transforms
tutorials/indices
tutorials/trainers
tutorials/pretrained_weights
tutorials/earth_surface_water

.. toctree::
:maxdepth: 1
:caption: PyTorch Libraries
Expand Down
18 changes: 18 additions & 0 deletions docs/tutorials/basic_usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Basic Usage
===========

The following tutorials introduce the basic concepts and components of TorchGeo:

* `Transforms <transforms.ipynb>`_: Preprocessing and data augmentation transforms for geospatial data
* `Indices <indices.ipynb>`_: Spectral indices
* `Pretrained Weights <pretrained_weights.ipynb>`_: Models and pretrained weights
* `Lightning Trainers <trainers.ipynb>`_: PyTorch Lightning data modules and trainers

.. toctree::
:hidden:
:maxdepth: 1

transforms
indices
pretrained_weights
trainers
14 changes: 14 additions & 0 deletions docs/tutorials/case_studies.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Case Studies
============

The following case studies present end-to-end workflows for common use cases of geospatial machine learning:

* `Earth Surface Water <earth_surface_water.ipynb>`_: A workflow for mapping surface water, including lakes and rivers

Do you have a use case that is missing from this list? Please open a pull request to add tutorials for your own use cases.

.. toctree::
:hidden:
:maxdepth: 1

earth_surface_water
6 changes: 5 additions & 1 deletion docs/tutorials/contribute_non_geo_dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@
"# Create dummy data for all splits and filenames\n",
"for split in splits:\n",
" for filename in image_file_names:\n",
" create_input_image(split, filename)\n",
" create_input_image(\n",
" os.path.join(root_dir, 'image', split, filename),\n",
" (IMG_SIZE, IMG_SIZE),\n",
" range(2**16),\n",
" )\n",
" create_target_images(split, filename.replace('_', '_target_'))\n",
"\n",
"# Zip directory\n",
Expand Down
20 changes: 20 additions & 0 deletions docs/tutorials/customization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Customization
=============

Is TorchGeo missing a dataset or model you need? Would you like to modify the default augmentations for a data module or extend a builtin trainer?

The following tutorials will teach you how to customize TorchGeo to meet your needs:

* `Custom Non-Geospatial Datasets <contribute_non_geo_dataset.ipynb>`_: How to create and contribute a new NonGeoDataset
* `Custom Raster Datasets <custom_raster_dataset.ipynb>`_: How to create a new RasterDataset
* `Custom Data Module <contribute_datamodule.ipynb>`_: How to create and contribute a new DataModule

TorchGeo is a community-driven open source library. If there is a feature missing that you would like to add, please open a pull request to add it. See the ref:`contributing` guidelines to get started.

.. toctree::
:hidden:
:maxdepth: 1

contribute_non_geo_dataset
custom_raster_dataset
contribute_datamodule
Loading
Loading