Class TemporalFlip<T>
- Namespace
- AiDotNet.Augmentation.Video
- Assembly
- AiDotNet.dll
Reverses the order of frames in a video.
public class TemporalFlip<T> : TemporalAugmenterBase<T>, IAugmentation<T, ImageTensor<T>[]>
Type Parameters
TThe numeric type for calculations.
- Inheritance
-
AugmentationBase<T, ImageTensor<T>[]>TemporalFlip<T>
- Implements
-
IAugmentation<T, ImageTensor<T>[]>
- Inherited Members
Remarks
For Beginners: Temporal flip plays the video backwards by reversing the frame order. This can help models become invariant to action direction, though it should be used carefully as some actions are not time-reversible.
When to use:
- Symmetric actions (walking back and forth, waving)
- Scene recognition where temporal direction doesn't matter
- Data augmentation for limited video datasets
When NOT to use:
- Actions with clear direction (falling down vs. jumping up)
- Tasks involving causality or temporal reasoning
Constructors
TemporalFlip(double, double)
Creates a new temporal flip augmentation.
public TemporalFlip(double probability = 0.3, double frameRate = 30)
Parameters
probabilitydoubleProbability of applying this augmentation (default: 0.3).
frameRatedoubleFrame rate of the video (default: 30).
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.