Albumentations 1.4.4 Release Notes
- Support our work
- Highlights
- Transforms
- Improvements and bug fixes
Support Our Work
- 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.
- Haven't starred our repo yet? Show your support with a ⭐! It's just only one mouse click.
- 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
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:
Added new normalizations to Normalize transform
standard
-subtract
fixed mean, divide by fixedstd
image
- the same asstandard
, butmean
andstd
computed for each image independently.image_per_channel
- the same as before, but per channelmin_max
- subtractmin(image)
and divide bymax(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
- Bugfix by @ayasyrev
- Transform updated to work even if side is not divisible by the number of tiles. by @ternaus
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
- Small speedup in the code for transforms that use
add_weighted
function by @gogetron - Fix in error message in Affine transform by @matsumotosan
- Bugfix in Sequential by @ayasyrev
Documentation
- Updated Contributor's guide. by @ternaus
- Added example notebook on how to apply D4 to images, masks, bounding boxes and key points. by @ternaus
- Added example notebook on how to apply RandomGridShuffle to images, masks and keypoints. by @ternaus