Which augmentations are available

Description

The transforms the installed ‘albumentations’ offers, and - for volumes - the ones it can actually apply to them.

Usage

available_transforms(rank = 2, pattern = NULL)

Arguments

rank 2 for images, 3 for volumes.
pattern Optional regular expression to filter the names, for browsing: “Flip”, “3D$”, “Elastic|Grid”.

Details

Worth asking rather than guessing. Support for volumes is uneven: most geometric transforms work and several intensity ones raise from inside the library, so rank = 3 returns a shorter list than rank = 2. A transform outside it is refused when the specification is built, by name, rather than failing an hour into training.

The number of names at rank = 2 is a property of the installed ‘albumentations’. The number at rank = 3 is not, and is deliberately not written down here. The engine finds that list by offering each transform a probe volume, and some of what it refuses fails for the probe’s reasons rather than the library’s: a group of transforms want three channels where the probe has one, and another group want a target - reference image, bounding box, metadata of their own - that a probe cannot supply and a specification cannot name either.

A third group used to fail on the probe’s size, which engine 0.8.0a10 fixed by retrying a refusal at a larger probe before believing it. That is also where a long-standing superstition went: the count used to vary between machines and was attributed to them, when the cause was one transform randomising its own parameters, so the same machine gave two answers. Escalating removed it. The count is still not promised, because it belongs to the installed library rather than to this package.

The check that decides your run is made when the specification is built, against your own shape and parameters.

Value

A character vector of transform names.

See Also

augmentation_step(), which uses one.

Examples

library("rplatypus")

available_transforms()                       # everything, for images
#> 118 names, with albumentations 2.0.8

available_transforms(rank = 3)               # what volumes can take: fewer

available_transforms(rank = 3, pattern = "Flip|Crop")
#> [1] "AtLeastOneBBoxRandomCrop" "CenterCrop"   "CenterCrop3D"
#> [4] "CropAndPad"   "CropNonEmptyMaskIfExists"  "HorizontalFlip"
#> [7] "RandomCrop"   "RandomCrop3D"              "RandomCropFromBorders"
#> [10] "RandomResizedCrop"  "RandomSizedBBoxSafeCrop"  "RandomSizedCrop"
#> [13] "VerticalFlip"

# Which ones a volume cannot take, by name rather than by count.
head(setdiff(available_transforms(), available_transforms(rank = 3)), 3)
#> [1] "AdditiveNoise"      "BBoxSafeRandomCrop" "ChannelDropout"