HorizontalFlip<T>

Models & Types · AiDotNet.Augmentation.Image

Flips an image horizontally (left-right mirror).

Inheritance: AugmentationBase<T, ImageTensor<T>> → SpatialAugmentationBase<T, ImageTensor<T>> → HorizontalFlip<T>

For Beginners

Think of this like looking in a mirror. The left side of the image becomes the right side, and vice versa. This is useful when training image classifiers because a cat is still a cat whether it’s facing left or right.

How It Works

Horizontal flipping mirrors the image along its vertical center axis, swapping the left and right sides. This is one of the most commonly used augmentations because many objects look the same when flipped horizontally (e.g., cars, animals, faces in frontal view).

When to use:

  • Image classification where horizontal orientation doesn’t matter
  • Object detection (boxes will be flipped automatically)
  • Pose estimation (keypoints will be swapped correctly)

When NOT to use:

  • Text recognition (text would become unreadable when mirrored)
  • Reading direction matters (left-to-right vs right-to-left)
  • Asymmetric objects where orientation is meaningful (e.g., traffic signs with arrows)

Constructors

Constructor Summary
HorizontalFlip(double probability) Creates a new horizontal flip augmentation.

Methods

Method Summary
IDictionary<string, object> GetParameters()