Back to Ultralytics

Augmentation Args

docs/macros/augmentation-args.md

8.4.467.6 KB
Original Source
ArgumentTypeDefaultSupported TasksRangeDescription
hsv_hfloat{{ hsv_h }}detect, segment, pose, obb, classify0.0 - 1.0Adjusts the hue of the image by a fraction of the color wheel, introducing color variability. Helps the model generalize across different lighting conditions.
hsv_sfloat{{ hsv_s }}detect, segment, pose, obb, classify0.0 - 1.0Alters the saturation of the image by a fraction, affecting the intensity of colors. Useful for simulating different environmental conditions.
hsv_vfloat{{ hsv_v }}detect, segment, pose, obb, classify0.0 - 1.0Modifies the value (brightness) of the image by a fraction, helping the model to perform well under various lighting conditions.
degreesfloat{{ degrees }}detect, segment, pose, obb0.0 - 180Rotates the image randomly within the specified degree range, improving the model's ability to recognize objects at various orientations.
translatefloat{{ translate }}detect, segment, pose, obb0.0 - 1.0Translates the image horizontally and vertically by a fraction of the image size, aiding in learning to detect partially visible objects.
scalefloat{{ scale }}detect, segment, pose, obb, classify0 - 1Scales the image by a gain factor, simulating objects at different distances from the camera.
shearfloat{{ shear }}detect, segment, pose, obb-180 - +180Shears the image by a specified degree, mimicking the effect of objects being viewed from different angles.
perspectivefloat{{ perspective }}detect, segment, pose, obb0.0 - 0.001Applies a random perspective transformation to the image, enhancing the model's ability to understand objects in 3D space.
flipudfloat{{ flipud }}detect, segment, pose, obb, classify0.0 - 1.0Flips the image upside down with the specified probability, increasing the data variability without affecting the object's characteristics.
fliplrfloat{{ fliplr }}detect, segment, pose, obb, classify0.0 - 1.0Flips the image left to right with the specified probability, useful for learning symmetrical objects and increasing dataset diversity.
bgrfloat{{ bgr }}detect, segment, pose, obb0.0 - 1.0Flips the image channels from RGB to BGR with the specified probability, useful for increasing robustness to incorrect channel ordering.
mosaicfloat{{ mosaic }}detect, segment, pose, obb0.0 - 1.0Combines four training images into one, simulating different scene compositions and object interactions. Highly effective for complex scene understanding.
mixupfloat{{ mixup }}detect, segment, pose, obb0.0 - 1.0Blends two images and their labels, creating a composite image. Enhances the model's ability to generalize by introducing label noise and visual variability.
cutmixfloat{{ cutmix }}detect, segment, pose, obb0.0 - 1.0Combines portions of two images, creating a partial blend while maintaining distinct regions. Enhances model robustness by creating occlusion scenarios.
copy_pastefloat{{ copy_paste }}segment0.0 - 1.0Copies and pastes objects across images to increase object instances.
copy_paste_modestr{{ copy_paste_mode }}segment-Specifies the copy-paste strategy to use. Options include 'flip' and 'mixup'.
auto_augmentstr{{ auto_augment }}classify-Applies a predefined augmentation policy ('randaugment', 'autoaugment', or 'augmix') to enhance model performance through visual diversity.
erasingfloat{{ erasing }}classify0.0 - 1.0Randomly erases regions of the image during training to encourage the model to focus on less obvious features.
augmentationslist{{ augmentations }}detect, segment, pose, obb-Custom Albumentations transforms for advanced data augmentation (Python API only). Accepts a list of transform objects for specialized augmentation needs.