Shortcuts

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:

Parameters
  • index_swir (int) –

  • index_nir (int) –

Return type

None

__init__(index_swir, index_nir)[source]

Initialize a new transform instance.

Parameters
  • index_swir (int) – index of the Short-wave Infrared (SWIR) band in the image

  • index_nir (int) – index of the Near Infrared (NIR) band in the image

Return type

None

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:

Parameters
  • index_green (int) –

  • index_swir (int) –

Return type

None

__init__(index_green, index_swir)[source]

Initialize a new transform instance.

Parameters
  • index_green (int) – index of the Green band in the image

  • index_swir (int) – index of the Short-wave Infrared (SWIR) band in the image

Return type

None

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:

Parameters
  • index_red (int) –

  • index_nir (int) –

Return type

None

__init__(index_red, index_nir)[source]

Initialize a new transform instance.

Parameters
  • index_red (int) – index of the Red band in the image

  • index_nir (int) – index of the Near Infrared (NIR) band in the image

Return type

None

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:

Parameters
  • index_green (int) –

  • index_nir (int) –

Return type

None

__init__(index_green, index_nir)[source]

Initialize a new transform instance.

Parameters
  • index_green (int) – index of the Green band in the image

  • index_nir (int) – index of the Near Infrared (NIR) band in the image

Return type

None

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
Return type

None

__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

None

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]

Read the Docs v: v0.1.1
Versions
latest
stable
v0.1.1
v0.1.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources