Factory Utils
Utility to handle augmentation configuration.
assemble_augmentations(augmentations, seed=None)
Assemble a list of augmentations.
Parameters:
-
augmentations(Sequence of {"x_flip", "y_flip", "rotate_90"} or None) –List of augmentations to apply. If
None, all augmentations are applied. -
seed(int | None, default:None) –Random seed for reproducibility.
Returns:
-
list of augmentations–List of augmentations to apply.
validate_input_channels(axes, channels, n_channels, attr_name='n_channels')
Validate channel dimensions.
Parameters:
-
axes(str) –Axes of the data (e.g. SYX).
-
channels(Sequence[int] | None) –List of channels to use. If
None, all channels are used. -
n_channels(int | None) –Number of channels (in and out). If
channelsis specified, then the number of channels is inferred from its length and this parameter is ignored. -
attr_name(str, default:'n_channels') –Name of the attribute to use in error messages (default: "n_channels").
Raises:
-
ValueError–If
channelsis specified butaxesdoes not include "C". Ifchannelsis specified but is empty. Ifchannelsis specified but its length does not matchn_channels. Ifn_channelsis specified butaxesdoes not include "C".