- Support our work
- Transforms
- Core functionality
- Deprecations
- 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 OverlayElements transform
Allows to paste set of images + corresponding masks to the image.
It is not entirely CopyAndPaste
as "masks", "bounding boxes" and "keypoints" are not supported, but step in that direction.
Affine
Added balanced sampling for scale_limit
From FAQ:
The default scaling logic in RandomScale
, ShiftScaleRotate
, and Affine
transformations is biased towards upscaling.
For example, if scale_limit = (0.5, 2)
, a user might expect that the image will be scaled down in half of the cases and scaled up in the other half. However, in reality, the image will be scaled up in 75% of the cases and scaled down in only 25% of the cases. This is because the default behavior samples uniformly from the interval [0.5, 2]
, and the interval [0.5, 1]
is three times smaller than [1, 2]
.
To achieve balanced scaling, you can use Affine with balanced_scale=True, which ensures that the probability of scaling up and scaling down is equal.
balanced_scale_transform = A.Compose([A.Affine(scale=(0.5, 2), balanced_scale=True)])
by @ternaus
RandomSizedBBoxSafeCrop
Added support for keypoints
by @ternaus
BBoxSafeRandomCrop
Added support for keypoints
by @ternaus
RandomToneCurve
- Now can sample noise per channel
- Works with any number of channels
- Now works not just with uint8, but with float32 images as well
by @zakajd
ISONoise
- BugFix
- Now works not just with uint8, but with float32 images as well
by @ternaus
Core
Added strict
parameter to Compose
If strict=True
only targets that are expected could be passed.
If strict = False
, user can pass data with extra keys. Such data would not be affected by transforms.
Request came from users that use pipelines in the form:
transform = A.Compose([....])
data = A.Compose(**data)
by @ayasyrev
Refactoring
Crop module was heavily refactored, all tests and checks pass, but we will see.
Deprecations
Grid Dropout
Old way:
GridDropout(
holes_number_x=XXX,
holes_numver_y=YYY,
unit_size_min=ZZZ,
unit_size_max=PPP
)
New way:
GridDropout(
holes_number_xy = (XXX, YYY),
unit_size_range = (ZZZ, PPP)
)
by @ternaus
RandomSunFlare
Old way:
RandomSunFlare(
num_flare_circles_lower = XXX,
num_flare_circles_upper = YYY
)
new way:
RandomSunFlare(num_flare_circles_range = (XXX, YYY))
Bugfixes
- Bugfix in
ISONoise
, as it returned zeros. by @ternaus - BugFix in
Affine
as during rotation image, mask, keypoints have one center point for rotation and bounding box another => we need to create two separate affine matrices. by @ternaus - Small fix in Error Message by @philipp-fischer
- Bugfix that affected many transforms, where users specified probability as number and not as
p=number
. Say forVerticalFlip(0.5)
you could expect 50% chance, but 0.5 was attributed not top
but toalways_apply
which meant that the transform was always applied. by @ayasyrev