Compose<T, TData>

Models & Types · AiDotNet.Augmentation

Applies multiple augmentations sequentially.

Implements: ISpatialAugmentation<T, TData>

For Beginners

Think of this like a recipe with multiple steps. First flip the image, then adjust brightness, then add noise. Each step transforms the result of the previous step.

How It Works

Compose chains multiple augmentations together, applying them one after another. Each augmentation sees the output of the previous one. This is the most common way to build augmentation pipelines.

Example usage:

Constructors

Constructor Summary
Compose(IAugmentation<T, TData>[] augmentations) Creates a new composition of augmentations.
Compose(IEnumerable<IAugmentation<T, TData>> augmentations, double probability) Creates a new composition of augmentations.

Properties

Property Summary
IReadOnlyList<IAugmentation<T, TData>> Augmentations { get; } Gets the list of augmentations in this composition.
bool IsEnabled { get; set; }
bool IsTrainingOnly { get; set; }
bool SupportsBoundingBoxes { get; }
bool SupportsKeypoints { get; }
bool SupportsMasks { get; }
double Probability { get; }
string Name { get; }

Methods

Method Summary
AugmentedSample<T, TData> ApplyWithTargets(AugmentedSample<T, TData> sample, AugmentationContext<T> context)
Compose<T, TData> With(IAugmentation<T, TData> augmentation) Creates a new composition with an additional augmentation appended.
IDictionary<string, object> GetParameters()
TData Apply(TData data, AugmentationContext<T> context)