Table of Contents

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

T

The numeric type for calculations.

Inheritance
TemporalFlip<T>
Implements
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

probability double

Probability of applying this augmentation (default: 0.3).

frameRate double

Frame 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

data ImageTensor<T>[]

The input data.

context AugmentationContext<T>

The augmentation context.

Returns

ImageTensor<T>[]

The augmented data.