torchgeo.transforms¶
TorchGeo transforms.
- class torchgeo.transforms.AppendNDBI(index_swir, index_nir)¶
Bases:
torch.nn.Module
Normalized Difference Built-up Index (NDBI).
If you use this dataset in your research, please cite the following paper:
- forward(sample)[source]¶
Create a band for NDBI and append to image channels.
- Parameters
sample (Dict[str, torch.Tensor]) – a single data sample
- Returns
a sample where the image has an additional channel representing NDBI
- Return type
Dict[str, torch.Tensor]
- class torchgeo.transforms.AppendNDSI(index_green, index_swir)¶
Bases:
torch.nn.Module
Normalized Difference Snow Index (NDSI).
If you use this dataset in your research, please cite the following paper:
- forward(sample)[source]¶
Create a band for NDSI and append to image channels.
- Parameters
sample (Dict[str, torch.Tensor]) – a single data sample
- Returns
a sample where the image has an additional channel representing NDSI
- Return type
Dict[str, torch.Tensor]
- class torchgeo.transforms.AppendNDVI(index_red, index_nir)¶
Bases:
torch.nn.Module
Normalized Difference Vegetation Index (NDVI).
If you use this dataset in your research, please cite the following paper:
- forward(sample)[source]¶
Create a band for NDVI and append to image channels.
- Parameters
sample (Dict[str, torch.Tensor]) – a single data sample
- Returns
a sample where the image has an additional channel representing NDVI
- Return type
Dict[str, torch.Tensor]
- class torchgeo.transforms.AppendNDWI(index_green, index_nir)¶
Bases:
torch.nn.Module
Normalized Difference Water Index (NDWI).
If you use this dataset in your research, please cite the following paper:
- forward(sample)[source]¶
Create a band for NDWI and append to image channels.
- Parameters
sample (Dict[str, torch.Tensor]) – a single data sample
- Returns
a sample where the image has an additional channel representing NDWI
- Return type
Dict[str, torch.Tensor]
- class torchgeo.transforms.AugmentationSequential(*args, data_keys)¶
Bases:
torch.nn.Module
Wrapper around kornia AugmentationSequential to handle input dicts.
- Parameters
args (torch.nn.Module) –
data_keys (List[str]) –
- Return type
- __init__(*args, data_keys)[source]¶
Initialize a new augmentation sequential instance.
- Parameters
*args – Sequence of kornia augmentations
data_keys (List[str]) – List of inputs to augment (e.g. [“image”, “mask”, “boxes”])
args (torch.nn.Module) –
- Return type
- forward(sample)[source]¶
Perform augmentations and update data dict.
- Parameters
sample (Dict[str, torch.Tensor]) – the input
- Returns
the augmented input
- Return type
Dict[str, torch.Tensor]