Class FrameDropout<T>
- Namespace
- AiDotNet.Augmentation.Video
- Assembly
- AiDotNet.dll
Randomly drops frames from video.
public class FrameDropout<T> : TemporalAugmenterBase<T>, IAugmentation<T, ImageTensor<T>[]>
Type Parameters
TThe numeric type for calculations.
- Inheritance
-
AugmentationBase<T, ImageTensor<T>[]>FrameDropout<T>
- Implements
-
IAugmentation<T, ImageTensor<T>[]>
- Inherited Members
Remarks
For Beginners: Frame dropout randomly removes some frames from the video, simulating frame drops in real-world video capture or network streaming. This helps models become robust to missing frames.
When to use:
- Training for real-world video processing with potential frame drops
- Reducing overfitting to exact frame sequences
- Simulating lower frame rate videos
Constructors
FrameDropout(double, int, double, double)
Creates a new frame dropout augmentation.
public FrameDropout(double dropoutRate = 0.1, int minFramesToKeep = 2, double probability = 0.3, double frameRate = 30)
Parameters
dropoutRatedoubleProbability of dropping each frame (default: 0.1).
minFramesToKeepintMinimum frames to keep (default: 2).
probabilitydoubleProbability of applying this augmentation (default: 0.3).
frameRatedoubleFrame rate of the video (default: 30).
Properties
DropoutRate
Gets the probability of dropping each frame.
public double DropoutRate { get; }
Property Value
Remarks
Default: 0.1 (10% of frames dropped)
MinFramesToKeep
Gets the minimum number of frames to keep.
public int MinFramesToKeep { get; }
Property Value
Remarks
Default: 2
Methods
ApplyAugmentation(ImageTensor<T>[], AugmentationContext<T>)
Implement this method to perform the actual augmentation.
protected override ImageTensor<T>[] ApplyAugmentation(ImageTensor<T>[] data, AugmentationContext<T> context)
Parameters
dataImageTensor<T>[]The input data.
contextAugmentationContext<T>The augmentation context.
Returns
- ImageTensor<T>[]
The augmented data.
GetParameters()
Gets the parameters of this augmentation.
public override IDictionary<string, object> GetParameters()
Returns
- IDictionary<string, object>
A dictionary of parameter names to values.