github albumentations-team/albumentations 1.4.4
Albumentations 1.4.4 Release Notes

latest releases: 1.4.21, 1.4.20, 1.4.19...
6 months ago

Albumentations 1.4.4 Release Notes

  • Support our work
  • Highlights
  • Transforms
  • Improvements and bug fixes

Support Our Work

  1. Love the library? You can contribute to its development by becoming a sponsor for the library. Your support is invaluable, and every contribution makes a difference.
  2. Haven't starred our repo yet? Show your support with a ⭐! It's just only one mouse click.
  3. Got ideas or facing issues? We'd love to hear from you. Share your thoughts in our issues or join the conversation on our Discord server for Albumentations

Transforms

Added D4 transform

image

Applies one of the eight possible D4 dihedral group transformations to a square-shaped input, maintaining the square shape. These transformations correspond to the symmetries of a square, including rotations and reflections by @ternaus

The D4 group transformations include:
- e (identity): No transformation is applied.
- r90 (rotation by 90 degrees counterclockwise)
- r180 (rotation by 180 degrees)
- r270 (rotation by 270 degrees counterclockwise)
- v (reflection across the vertical midline)
- hvt (reflection across the anti-diagonal)
- h (reflection across the horizontal midline)
- t (reflection across the main diagonal)

Could be applied to:

  • image
  • mask
  • bounding boxes
  • key points

Does not generate interpolation artifacts as there is no interpolation.

Provides the most value in tasks where data is invariant to rotations and reflections like:

  • Top view drone and satellite imagery
  • Medical images

Example:

Screenshot 2024-04-16 at 19 00 05

Added new normalizations to Normalize transform

  • standard - subtract fixed mean, divide by fixed std
  • image - the same as standard, but mean and std computed for each image independently.
  • image_per_channel - the same as before, but per channel
  • min_max - subtract min(image)and divide by max(image) - min(image)
  • min_max_per_channel - the same, but per channel
    by @ternaus

Changes in the interface of RandomShadow

New, preferred wat is to use num_shadows_limit instead of num_shadows_lower / num_shadows_upper by @ayasyrev

Improvements and bug fixes

Added check for input parameters to transforms with Pydantic

Now all input parameters are validated and prepared with Pydantic. This will prevent bugs, when transforms are initialized without errors with parameters that are outside of allowed ranges.
by @ternaus

Updates in RandomGridShuffle

  1. Bugfix by @ayasyrev
  2. Transform updated to work even if side is not divisible by the number of tiles. by @ternaus

Example:
image

New way to add additional targets

Standard way uses additional_targets

transform = A.Compose(
    transforms=[A.Rotate(limit=(90.0, 90.0), p=1.0)],
    keypoint_params=A.KeypointParams(
        angle_in_degrees=True,
        check_each_transform=True,
        format="xyas",
        label_fields=None,
        remove_invisible=False,
    ),
    additional_targets={"keypoints2": "keypoints"},
)

Now you can also add them using add_targets:

transform = A.Compose(
    transforms=[A.Rotate(limit=(90.0, 90.0), p=1.0)],
    keypoint_params=A.KeypointParams(
        angle_in_degrees=True,
        check_each_transform=True,
        format="xyas",
        label_fields=None,
        remove_invisible=False,
    ),
)
transform.add_targets({"keypoints2": "keypoints"})

by @ayasyrev

Small fixes

Documentation

Don't miss a new albumentations release

NewReleases is sending notifications on new releases.