Table of Contents

Class SpeedChange<T>

Namespace
AiDotNet.Augmentation.Video
Assembly
AiDotNet.dll

Changes the playback speed of video by resampling frames.

public class SpeedChange<T> : TemporalAugmenterBase<T>, IAugmentation<T, ImageTensor<T>[]>

Type Parameters

T

The numeric type for calculations.

Inheritance
SpeedChange<T>
Implements
Inherited Members

Remarks

For Beginners: Speed change makes video play faster or slower by keeping/skipping/duplicating frames. This simulates different action speeds and helps models recognize actions regardless of how fast they're performed.

Speed factors:

  • 2.0 = double speed (skip every other frame)
  • 1.0 = normal speed
  • 0.5 = half speed (duplicate frames)

Constructors

SpeedChange(double, double, double, double)

Creates a new speed change augmentation.

public SpeedChange(double minSpeed = 0.8, double maxSpeed = 1.2, double probability = 0.5, double frameRate = 30)

Parameters

minSpeed double

Minimum speed factor (default: 0.8).

maxSpeed double

Maximum speed factor (default: 1.2).

probability double

Probability of applying this augmentation (default: 0.5).

frameRate double

Frame rate of the video (default: 30).

Properties

MaxSpeed

Gets the maximum speed factor.

public double MaxSpeed { get; }

Property Value

double

Remarks

Default: 1.2 (20% faster)

MinSpeed

Gets the minimum speed factor.

public double MinSpeed { get; }

Property Value

double

Remarks

Default: 0.8 (20% slower)

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.

GetParameters()

Gets the parameters of this augmentation.

public override IDictionary<string, object> GetParameters()

Returns

IDictionary<string, object>

A dictionary of parameter names to values.