torchgeo.transforms¶
TorchGeo transforms.
- class torchgeo.transforms.AppendNormalizedDifferenceIndex(index_a, index_b)¶
Bases:
torch.nn.Module
Append normalized difference index as channel to image tensor.
New in version 0.2.
- forward(sample)[source]¶
Compute and append normalized difference index to image.
- Parameters
sample (Dict[str, torch.Tensor]) – a sample or batch dict
- Returns
the transformed sample
- Return type
Dict[str, torch.Tensor]
- class torchgeo.transforms.AppendNBR(index_nir, index_swir)¶
Bases:
torchgeo.transforms.AppendNormalizedDifferenceIndex
Normalized Burn Ratio (NBR).
If you use this index in your research, please cite the following paper:
New in version 0.2.0.
- class torchgeo.transforms.AppendNDBI(index_swir, index_nir)¶
Bases:
torchgeo.transforms.AppendNormalizedDifferenceIndex
Normalized Difference Built-up Index (NDBI).
If you use this index in your research, please cite the following paper:
- class torchgeo.transforms.AppendNDSI(index_green, index_swir)¶
Bases:
torchgeo.transforms.AppendNormalizedDifferenceIndex
Normalized Difference Snow Index (NDSI).
If you use this index in your research, please cite the following paper:
- class torchgeo.transforms.AppendNDVI(index_red, index_nir)¶
Bases:
torchgeo.transforms.AppendNormalizedDifferenceIndex
Normalized Difference Vegetation Index (NDVI).
If you use this index in your research, please cite the following paper:
- class torchgeo.transforms.AppendNDWI(index_green, index_nir)¶
Bases:
torchgeo.transforms.AppendNormalizedDifferenceIndex
Normalized Difference Water Index (NDWI).
If you use this index in your research, please cite the following paper:
- class torchgeo.transforms.AugmentationSequential(*args, data_keys)¶
Bases:
torch.nn.Module
Wrapper around kornia AugmentationSequential to handle input dicts.
- __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”])
- 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]