Class VideoAugmenterBase<T>
- Namespace
- AiDotNet.Augmentation.Video
- Assembly
- AiDotNet.dll
Base class for video data augmentations.
public abstract class VideoAugmenterBase<T> : AugmentationBase<T, ImageTensor<T>[]>, IAugmentation<T, ImageTensor<T>[]>
Type Parameters
TThe numeric type for calculations.
- Inheritance
-
AugmentationBase<T, ImageTensor<T>[]>VideoAugmenterBase<T>
- Implements
-
IAugmentation<T, ImageTensor<T>[]>
- Derived
- Inherited Members
Remarks
For Beginners: Video augmentation transforms sequences of frames to improve model robustness to temporal variations. It combines:
- Temporal augmentations (time-based): cropping, reversing, speed changes
- Spatial augmentations (frame-based): flips, rotations, color changes applied consistently across frames
Video data is represented as an array of ImageTensor frames.
Constructors
VideoAugmenterBase(double, double)
Initializes a new video augmentation.
protected VideoAugmenterBase(double probability = 1, double frameRate = 30)
Parameters
probabilitydoubleThe probability of applying this augmentation (0.0 to 1.0).
frameRatedoubleThe frame rate of the video in fps.
Properties
FrameRate
Gets or sets the frame rate of the video in frames per second.
public double FrameRate { get; set; }
Property Value
Remarks
Default: 30 fps (common for most video)
Other common values: 24 fps (film), 25 fps (PAL), 60 fps (high frame rate)
Methods
GetDuration(ImageTensor<T>[])
Gets the duration of the video in seconds.
protected double GetDuration(ImageTensor<T>[] frames)
Parameters
framesImageTensor<T>[]The video frames.
Returns
- double
The duration in seconds.
GetFrameCount(ImageTensor<T>[])
Gets the number of frames in the video.
protected int GetFrameCount(ImageTensor<T>[] frames)
Parameters
framesImageTensor<T>[]The video frames.
Returns
- int
The frame count.
GetParameters()
Gets the parameters of this augmentation.
public override IDictionary<string, object> GetParameters()
Returns
- IDictionary<string, object>
A dictionary of parameter names to values.
ValidateFrameDimensions(ImageTensor<T>[])
Validates that all frames have the same dimensions.
protected void ValidateFrameDimensions(ImageTensor<T>[] frames)
Parameters
framesImageTensor<T>[]The video frames to validate.
Exceptions
- ArgumentException
Thrown if frames have inconsistent dimensions.