diff --git a/docs/tutorials/custom_raster_dataset.ipynb b/docs/tutorials/custom_raster_dataset.ipynb index 99a981f9d2b..29d55c6fd18 100644 --- a/docs/tutorials/custom_raster_dataset.ipynb +++ b/docs/tutorials/custom_raster_dataset.ipynb @@ -332,6 +332,10 @@ "\n", "If your data only contains model inputs (such as images), use `is_image = True`. If your data only contains ground truth model outputs (such as segmentation masks), use `is_image = False` instead.\n", "\n", + "Consequently, the sample returned by the dataset/data loader will use the \"image\" key if *is_image* is True, otherwise it will use the \"mask\" key.\n", + "\n", + "For datasets with both model inputs and outputs, the recommended approach is to use 2 `RasterDataset` instances and combine them using an `IntersectionDataset`. See L7 Irish, L8 Biome, and I/O Bench for examples of this in `torchgeo/datasets`.\n", + "\n", "### `dtype`\n", "\n", "Defaults to float32 for `is_image == True` and long for `is_image == False`. This is what you want for 99% of datasets, but can be overridden for tasks like pixel-wise regression (where the target mask should be float32).\n", diff --git a/torchgeo/datasets/geo.py b/torchgeo/datasets/geo.py index 8233480443a..9dd886723bb 100644 --- a/torchgeo/datasets/geo.py +++ b/torchgeo/datasets/geo.py @@ -361,8 +361,8 @@ class RasterDataset(GeoDataset): #: The sample returned by the dataset/data loader will use the "image" key if #: *is_image* is True, otherwise it will use the "mask" key. #: - #: For datasets with both model inputs and outputs, a custom - #: :func:`~RasterDataset.__getitem__` method must be implemented. + #: For datasets with both model inputs and outputs, the recommended approach is + #: to use 2 `RasterDataset` instances and combine them using an `IntersectionDataset`. is_image = True #: True if data is stored in a separate file for each band, else False.