- Support our work
- Transforms
- Core functionality
- Deprecations
- Improvements and bug fixes
Support Our Work
1. Love the library? You can contribute to its development by becoming a [sponsor for the library](https://github.com/sponsors/albumentations-team). 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](https://github.com/albumentations-team/albumentations).
3. Got ideas or facing issues? We'd love to hear from you. Share your thoughts in our [issues](https://github.com/albumentations-team/albumentations/issues) or join the conversation on our [Discord server for Albumentations](https://discord.gg/AmMnDBdzYs)
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.
[Example Notebook](https://github.com/albumentations-team/albumentations_examples/blob/main/notebooks/example_OverlayElements.ipynb)
![image](https://github.com/albumentations-team/albumentations/assets/5481618/2e0ebf10-fda4-430f-bfd2-b00d5825d9b2)
Affine
Added balanced sampling for `scale_limit`
From [FAQ](https://albumentations.ai/docs/faq/#how-to-perform-balanced-scaling):
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.
python
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
1. Now can sample noise per channel
2. Works with any number of channels
3. Now works not just with uint8, but with float32 images as well
by zakajd
ISONoise
1. BugFix
2. 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:
python
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:
python
GridDropout(
holes_number_x=XXX,
holes_numver_y=YYY,
unit_size_min=ZZZ,
unit_size_max=PPP
)
New way:
python
GridDropout(
holes_number_xy = (XXX, YYY),
unit_size_range = (ZZZ, PPP)
)
by ternaus
RandomSunFlare
Old way:
python
RandomSunFlare(
num_flare_circles_lower = XXX,
num_flare_circles_upper = YYY
)
new way:
python
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 for `VerticalFlip(0.5)` you could expect 50% chance, but 0.5 was attributed not to `p` but to `always_apply` which meant that the transform was always applied. by ayasyrev