Scale<T>
Models & Types · AiDotNet.Augmentation.Image
Scales an image by a random factor within a specified range.
Inheritance: AugmentationBase<T, ImageTensor<T>> → SpatialAugmentationBase<T, ImageTensor<T>> → Scale<T>
For Beginners
Think of this like zooming in or out on your camera. The same object photographed from closer or farther appears at different sizes. This augmentation teaches your model to recognize objects regardless of their size.
How It Works
Scale randomly resizes the image by a factor sampled from the specified range. This simulates viewing objects from different distances, helping the model become robust to scale variations.
When to use:
- Object detection where objects appear at various sizes
- Image classification with variable-sized subjects
- When training data lacks size diversity
Constructors
| Constructor | Summary |
|---|---|
Scale(double minScale, double maxScale, double probability, InterpolationMode interpolation, BorderMode borderMode, T borderValue) |
Creates a new scale augmentation. |
Properties
| Property | Summary |
|---|---|
BorderMode BorderMode { get; } |
Gets the border mode when pixels fall outside the original image bounds. |
InterpolationMode Interpolation { get; } |
Gets the interpolation mode for pixel sampling. |
T BorderValue { get; } |
Gets the constant value used when BorderMode is Constant. |
double MaxScale { get; } |
Gets the maximum scale factor. |
double MinScale { get; } |
Gets the minimum scale factor. |
Methods
| Method | Summary |
|---|---|
IDictionary<string, object> GetParameters() |