diff --git a/docs/tutorials/transforms.ipynb b/docs/tutorials/transforms.ipynb index 38a9b825bb..0f4a4ef73c 100644 --- a/docs/tutorials/transforms.ipynb +++ b/docs/tutorials/transforms.ipynb @@ -20,6 +20,13 @@ "# Transforms" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "_Written by: Adam J. Stewart, Ashwin Nair and Heng Fang_" + ] + }, { "cell_type": "markdown", "metadata": { @@ -408,7 +415,7 @@ "id": "p28C8cTGE3dP" }, "source": [ - "Transforms are able to operate across batches of samples and singular samples. This allows them to be used inside the dataset itself or externally, chained together with other transform operations using `nn.Sequential`. " + "`torchgeo.transforms` work seamlessly with both singular samples and batches of data. They can be applied within datasets or externally and combined with other transforms using `nn.Sequential`. Built for multispectral imagery, they are fully compatible with `torchvision.transforms` and `kornia.augmentation`." ] }, { @@ -429,13 +436,39 @@ "print(x.dtype, x.min(), x.max())" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Appending Indices with `torchgeo.transforms`\n", + "\n", + "`torchgeo.transforms` support appending indices to a specified channel dimension. The following transforms are available:\n", + "\n", + "- **AppendBNDVI**\n", + "- **AppendGBNDVI**\n", + "- **AppendGNDVI**\n", + "- **AppendGRNDVI**\n", + "- **AppendNBR**\n", + "- **AppendNDBI**\n", + "- **AppendNDRE**\n", + "- **AppendNDSI**\n", + "- **AppendNDVI**\n", + "- **AppendNDWI**\n", + "- **AppendNormalizedDifferenceIndex**\n", + "- **AppendRBNDVI**\n", + "- **AppendSWI**\n", + "- **AppendTriBandNormalizedDifferenceIndex**\n", + "\n", + "For detailed usage, refer to the [official documentation](https://torchgeo.readthedocs.io/en/stable/api/transforms.html)." + ] + }, { "cell_type": "markdown", "metadata": { "id": "KRjb-u0EEmDf" }, "source": [ - "Indices can also be computed on batches of images and appended as an additional band to the specified channel dimension. Notice how the number of channels increases from 13 -> 14." + "The following example shows how indices can be computed on batches of images and appended as an additional band to the specified channel dimension. Notice how the number of channels increases from 13 -> 14." ] }, { @@ -500,7 +533,9 @@ "id": "w4ZbjxPyHoiB" }, "source": [ - "It's even possible to chain indices along with augmentations from Kornia for a single callable during training." + "It's even possible to chain indices along with augmentations from Kornia for a single callable during training.\n", + "\n", + "Check out the documentation of Kornia's augmentations [here](https://kornia.readthedocs.io/en/latest/augmentation.html)." ] }, { @@ -515,6 +550,8 @@ }, "outputs": [], "source": [ + "# When using Kornia with a dictionary input, \n", + "# you must explicitly set data_keys=None during the creation of the augmentation pipeline.\n", "transforms = K.AugmentationSequential(\n", " MinMaxNormalize(mins, maxs),\n", " indices.AppendNDBI(index_swir=11, index_nir=7),\n", @@ -717,7 +754,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.8" + "version": "3.11.6" } }, "nbformat": 4,