Releases: albumentations-team/albumentations
Albumentations 1.4.9 Release Notes
- Support our work
- New transforms
- Integrations
- Speedups
- 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
PlanckianJitter
New transform, based on
![Screenshot 2024-06-17 at 17 53 00](https://private-user-images.githubusercontent.com/5481618/340495537-d042299a-3fcd-47e2-a2f8-c023646659d1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4MjE2NzQsIm5iZiI6MTczOTgyMTM3NCwicGF0aCI6Ii81NDgxNjE4LzM0MDQ5NTUzNy1kMDQyMjk5YS0zZmNkLTQ3ZTItYTJmOC1jMDIzNjQ2NjU5ZDEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMTk0MjU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTVkNGJlNWY2MGM3ODdmMzUwZDUzYTMwNzJjMDA1ZmJmZWRlM2IzZWQzNmIwMjEyYjA4MTI2OWZmYjhjNWQyZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.wMMMAZOLUUH6rTRD1w-Q6O6JQny2BiOSq21RrrSlxv4)
Statements from the paper on why PlanckianJitter is superior to ColorJitter:
-
Realistic Color Variations: PlanckianJitter applies physically realistic illuminant variations based on Planck’s Law for black-body radiation. This leads to more natural and realistic variations in chromaticity compared to the arbitrary changes in hue, saturation, brightness, and contrast applied by ColorJitter.
-
Improved Representation for Color-Sensitive Tasks: The transformations in PlanckianJitter maintain the ability to discriminate image content based on color information, making it particularly beneficial for tasks where color is a crucial feature, such as classifying natural objects like birds or flowers. ColorJitter, on the other hand, can significantly alter colors, potentially degrading the quality of learned color features.
-
Robustness to Illumination Changes: PlanckianJitter produces models that are robust to illumination changes commonly observed in real-world images. This robustness is advantageous for applications where lighting conditions can vary widely.
-
Enhanced Color Sensitivity: Models trained with PlanckianJitter show a higher number of color-sensitive neurons, indicating that these models retain more color information compared to those trained with ColorJitter, which tends to induce color invariance.
by @zakajd
GaussNoise
Added option to approximate GaussNoise.
Generation of random Noise for large images is slow.
Added scaling factor for noise generation. Value should be in the range (0, 1]
. When set to 1, noise is sampled for each pixel independently. If less, noise is sampled for a smaller size and resized to fit the shape of the image. Smaller values make the transform much faster. Default: 0.5
Integrations
Added integration wit HFHub. Now you can load and save augmentation pipeline to HuggingFace and reuse it in the future or share with others.
import albumentations as A
import numpy as np
transform = A.Compose([
A.RandomCrop(256, 256),
A.HorizontalFlip(),
A.RandomBrightnessContrast(),
A.RGBShift(),
A.Normalize(),
])
evaluation_transform = A.Compose([
A.PadIfNeeded(256, 256),
A.Normalize(),
])
transform.save_pretrained("qubvel-hf/albu", key="train")
# ^ this will save the transform to a directory "qubvel-hf/albu" with filename "albumentations_config_train.json"
transform.save_pretrained("qubvel-hf/albu", key="train", push_to_hub=True)
# ^ this will save the transform to a directory "qubvel-hf/albu" with filename "albumentations_config_train.json"
# + push the transform to the Hub to the repository "qubvel-hf/albu"
transform.push_to_hub("qubvel-hf/albu", key="train")
# ^ this will push the transform to the Hub to the repository "qubvel-hf/albu" (without saving it locally)
loaded_transform = A.Compose.from_pretrained("qubvel-hf/albu", key="train")
# ^ this will load the transform from local folder if exist or from the Hub repository "qubvel-hf/albu"
evaluation_transform.save_pretrained("qubvel-hf/albu", key="eval", push_to_hub=True)
# ^ this will save the transform to a directory "qubvel-hf/albu" with filename "albumentations_config_eval.json"
loaded_evaluation_transform = A.Compose.from_pretrained("qubvel-hf/albu", key="eval")
# ^ this will load the transform from the Hub repository "qubvel-hf/albu"
by @qubvel
Speedups
These transforms should be faster for all types of images. But measured only for three channel uint8
- RGBShift: 2X (+106%)
- GaussNoise: 3.3X (+ 236%)
Deprecations
Deprecated always_apply
For years we had two parameters in constructors - probability
and always_apply
. The interplay between them is not always obvious and intuitively always_apply=True
should be equivalent to p=1
.
always_apply
is deprecated now. always_apply=True
still works, but it will be deprecated in the future. Use p=1
instead
by @ayasyrev
RandomFog
Updated interface for RandomFog
Old way:
RandomFog(fog_coef_lower=0.3, fog_coef_upper=1)
New way:
RandomFog(fog_coef_range=(0.3, 1))
by @ternaus
Improvements and bugfixes
Disable check for updates
When one imports Albumentations library, there is a check that it is the latest version installed.
To disable this check you can set up environmental variable: NO_ALBUMENTATIONS_UPDATE
to 1
by @lerignoux
Fix for deprecation warnings
For a set of transforms we were throwing deprecation warnings, even when modern version of the interface was used. Fixed. by @ternaus
Albucore
We moved low level operations like add, multiply, normalize, etc to a separate library: https://github.com/albumentations-team/albucore
There are numerous ways to perform such operations in opencv and numpy. And there is no clear winner. Results depend on image type.
Separate library gives us confidence that we picked the fastest version that works on any image type.
by @ternaus
Bugfixes
Various bugfixes by @ayasyrev @immortalCO
Albumentations 1.4.8 Release Notes
- Support our work
- Documentation
- 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
Documentation
Added to the documentation links to the UI on HuggingFace to explore hyperparameters visually.
Deprecations
RandomSnow
Updated interface:
Old way:
transform = A.Compose([A.RandomSnow(
snow_point_lower=0.1,
snow_point_upper=0.3,
p=0.5
)])
New way:
transform = A.Compose([A.RandomSnow(
snow_point_range=(0.1, 0.3),
p=0.5
)])
RandomRain
Old way
transform = A.Compose([A.RandomSnow(
slant_lower=-10,
slant_upper=10,
p=0.5
)])
New way:
transform = A.Compose([A.RandomRain(
slant_range=(-10, 10),
p=0.5
)])
Improvements
Created library with core functions albucore. Moved a few helper functions there.
We need this library to be sure that transforms are:
- At least as fast as
numpy
andopencv
. For some functions it is possible to be faster than both of them. - Easier to debug.
- Could be used in other projects, not related to Albumentations.
Bugfixes
- Bugfix in
check_for_updates
. Now the pipeline does not throw an error regardless of why we cannot check for update. - Bugfix in
RandomShadow
. Does not create unexpected purple color on bright white regions with shadow overlay anymore. - BugFix in
Compose
. NowCompose([])
does not throw an error, but just works asNoOp
by @ayasyrev - Bugfix in
min_max
normalization. Now return 0 and not NaN on constant images. by @ternaus - Bugfix in
CropAndPad
. Now we can sample pad/crop values for all sides with interface like((-0.1, -0.2), (-0.2, -0.3), (0.3, 0.4), (0.4, 0.5))
by @christian-steinmeyer - Small refactoring to decrease tech debt by @ternaus and @ayasyrev
Albumentations 1.4.7 Release Notes
- Support our work
- Documentation
- 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
Documentation
- Added to the website tutorial on how to use Albumentations with Hugginigface for object Detection. Based on the tutorial by @qubvel
Deprecations
ImageCompression
Old way:
transform = A.Compose([A.ImageCompression(
quality_lower=75,
quality_upper=100,
p=0.5
)])
New way:
transform = A.Compose([A.ImageCompression(
quality_range=(75, 100),
p=0.5
)])
Downscale
Old way:
transform = A.Compose([A.Downscale(
scale_min=0.25,
scale_max=1,
interpolation= {"downscale": cv2.INTER_AREA, "upscale": cv2.INTER_CUBIC},
p=0.5
)])
New way:
transform = A.Compose([A.Downscale(
scale_range=(0.25, 1),
interpolation_pair = {"downscale": cv2.INTER_AREA, "upscale": cv2.INTER_CUBIC},
p=0.5
)])
As of now both ways work and will provide the same result, but old functionality will be removed in later releases.
by @ternaus
Improvements
- Buggix in
Blur
. - Bugfix in
bbox clipping
, it could be not intuitive, but boxes should be clipped byheight, width
and notheight - 1, width -1
by @ternaus - Allow to compose only keys, that are required there. Any extra unnecessary key will give an error by @ayasyrev
- In
PadIfNeeded
if value parameter is not None, but border mode is reflection, border mode is changed tocv2.BORDER_CONSTANT
by @ternaus
Albumentations 1.4.6 Release Notes
This is out of schedule release with a bugfix that was introduced in version 1.4.5
In version 1.4.5 there was a bug that went unnoticed - if you used pipeline that consisted only of ImageOnly
transforms but pass bounding boxes into it, you would get an error.
If you had in such pipeline at least one non ImageOnly
transform, say HorizontalFlip
or Crop
, everything would work as expected.
We fixed the issue and added tests to be sure that it will not happen in the future.
Albumentations 1.4.5 Release Notes
- Support our work
- Highlights
- 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
Highlights
Bbox clipping
Before version 1.4.5 it was assumed that bounding boxes that are fed into the augmentation pipeline should not extend outside of the image.
Now we added an option to clip boxes to the image size before augmenting them. This makes pipeline more robust to inaccurate labeling
Example:
Will fail if boxes extend outside of the image:
transform = A.Compose([
A.HorizontalFlip(p=0.5)
], bbox_params=A.BboxParams(format='coco'))
Clipping bounding boxes to the image size:
transform = A.Compose([
A.HorizontalFlip(p=0.5)
], bbox_params=A.BboxParams(format='coco', clip=True))
by @ternaus
SelectiveChannelTransform
Added SelectiveChannelTransform that allows to apply transforms to a selected number of channels.
For example it could be helpful when working with multispectral images, when RGB is a subset of the overall multispectral stack which is common when working with satellite imagery.
Example:
aug = A.Compose(
[A.HorizontalFlip(p=0.5),
A.SelectiveChannelTransform(transforms=[A.ColorJItter(p=0.5),
A.ChromaticAberration(p=0.5))], channels=[1, 2, 18], p=1)],
)
Here HorizontalFlip applied to the whole multispectral image, but pipeline of ColorJitter
and ChromaticAberration
only to channels [1, 2, 18]
by @ternaus
Deprecations
CoarseDropout
Old way:
transform = A.Compose([A.CoarseDropout(
min_holes = 5,
max_holes = 8,
min_width = 3,
max_width = 12,
min_height = 4,
max_height = 5
)])
New way:
transform = A.Compose([A.CoarseDropout(
num_holes_range=(5, 8),
hole_width_range=(3, 12),
hole_height_range=(4, 5)
)])
As of now both ways work and will provide the same result, but old functionality will be removed in later releases.
Improvements and bug fixes
- Number of fixes and speedups in the core of the library
Compose
andBasicTransform
by @ayasyrev - Extended
Contributor's guide
by @ternaus - Can use
random
forfill_value
inCoarseDropout
by @ternaus - Fix in ToGray docstring by @wilderrodrigues
- BufFix in D4 - now works not only with square, but with rectangular images as well. By @ternaus
- BugFix in RandomCropFromBorders by @ternaus
Albumentations 1.4.4 Release Notes
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:
![Screenshot 2024-04-16 at 19 00 05](https://private-user-images.githubusercontent.com/5481618/323045849-141a778e-33d5-4804-8a96-167b9bcbe621.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4MjE2NzQsIm5iZiI6MTczOTgyMTM3NCwicGF0aCI6Ii81NDgxNjE4LzMyMzA0NTg0OS0xNDFhNzc4ZS0zM2Q1LTQ4MDQtOGE5Ni0xNjdiOWJjYmU2MjEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMTk0MjU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTk2NTVjMWJiMDRkY2U5ZGMzNWE1ZTFmZGY5ZjMyNjM4OGNkNDk0ZDA5ODkxZjUwNjkyZGMwMGFkOTE2OWU5YiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.N-wmwqiijSmD5cWJHmX_RV5pk-u2sjvEgw_gg5PVSSs)
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
Albumentations 1.4.3 Release Notes
Albumentations 1.4.3 Release Notes
- Request
- Highlights
- New transform
- Minor 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
New transform
![Screenshot 2024-04-02 at 18 43 51](https://private-user-images.githubusercontent.com/5481618/319006343-e9c95aab-b2a8-4b12-9d72-86041b08f3ed.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4MjE2NzQsIm5iZiI6MTczOTgyMTM3NCwicGF0aCI6Ii81NDgxNjE4LzMxOTAwNjM0My1lOWM5NWFhYi1iMmE4LTRiMTItOWQ3Mi04NjA0MWIwOGYzZWQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMTk0MjU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjgwZTY2ZTNiMDMwNzI5Zjc2ZjRkZGMzMTdjODczNmYyOWY1ZWFlOWJkZDI2MDJiZjdiYTU5ZjI2N2ZlNTI4OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.XYXEYbUzSYZOgzzzH5jX8KGBHlgjBq6xgonOPVt6Bt8)
- Added
Morphological
transform that modifies the structure of the image. Dilation expands the white (foreground) regions in a binary or grayscale image, while erosion shrinks them.
Minor improvements and bug fixes
- Updated benchmark for uint8 images, processed on CPU. Added Kornia and Augly. LINK by @ternaus
- Bugfix in FDA transform by @ternaus
- Now RandomSizedCrop supports the same signature as analogous transform in torchvision by @zetyquickly
1.4.2
Albumentations 1.4.2 Release Notes
- Request
- Highlights
- New transform
- New functionality
- Improvements and bug fixes
Request
- If you enjoy using the library as an individual developer or as a representative of the company please consider becoming a sponsor for the library. Every dollar helps.
- If you did not give our repo a ⭐, it is only one mouse click
- If you have feature requests or proposals or encounter issues - submit your request to issues or ask in Discord server for Albumentations
New transform
Left: Original, Middle: Chromatic aberration (default args, mode="green_purple"), Right: Chromatic aberration (default args, mode="red_blue")
(Image is from our internal mobile mapping dataset)
New functionality
- Return
mixing parameter
forMixUp
transform by @Dipet. For more details Tutorial on MixUp
Improvements and Bugfixes
- Do not throw deprecation warning when people do not use deprecated parameters in
AdvancedBlur
by @Aloqeely - Updated
CONTRIBUTORS.md
for Windows users by @Aloqeely - Fixed Docstring for
DownScale
transform by @ryoryon66 - Bugfix in
PadIfNeeded
serialization @ternaus
1.4.1
Albumentations 1.4.1 Release Notes
- Request
- Highlights
- New transform
- Improvements
- Bug fixes
Request
- If you enjoy using the library as an individual developer or during the day job as a part of the company, please consider becoming a sponsor for the library. Every dollar helps.
- If you did not give our repo a ⭐, it is only one mouse click
- If you have feature requests or proposals or encounter issues - submit your request to issues or our new initiative, - Discord server for albumentations
New transform
![Screenshot 2024-03-04 at 14 52 15](https://private-user-images.githubusercontent.com/5481618/309937835-68e5031b-e45e-4578-abe8-1d8e33db4831.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4MjE2NzQsIm5iZiI6MTczOTgyMTM3NCwicGF0aCI6Ii81NDgxNjE4LzMwOTkzNzgzNS02OGU1MDMxYi1lNDVlLTQ1NzgtYWJlOC0xZDhlMzNkYjQ4MzEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMTk0MjU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODk2MGM2OTEzZDdiNzhiNTU1NmE4YzcyMzI1MmY3ZDFhODM0YWE0MmFmY2RmMDkyZmFkYTJmMWRkMmRiMTM1ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.cpdHD5U2E1MLljsk4g8ZOkJDJAqxz65N7ZDxLXfImvY)
- Added
MixUp
transform: which linearly combines an input (image, mask, and class label) with another set from a predefined reference dataset. The mixing degree is controlled by a parameter λ (lambda), sampled from a Beta distribution. This method is known for improving model generalization by promoting linear behavior between classes and smoothing decision boundaries.
Minor changes and Bug Fixes
- Moved from
isort
,flake8
,black
toruff
- Added extra checks for docstrings to match Google Style.
- Updated Who's using
- Removed quidda dependency, which addresses
opencv
library inconsistencies issues - New, updated version of benchmark.
1.4.0
Albumentations 1.4.0 Release Notes
- Request
- Highlights
- New transform
- Backwards Incompatible Changes
- Improvements
- Bug fixes
Request
- If you enjoy using the library as an individual developer or during the day job as a part of the company, please consider becoming a sponsor for the library. Every dollar helps.
- If you did not give our repo a ⭐, it is [only one mouse click].(https://github.com/albumentations-team/albumentations)
- If you have feature requests, proposals, or encounter issues - submit your request to issues or, our new initiative, - Discord server for albumentations
Highlights
In this release, we mainly focused on the technical debt as its decrease allows faster iterations and bug fixes in the codebase. We added only one new transform, did not work on speeding up transforms, and other changes are minor.
- We are removing the dependency on the imgaug library. The library was one of our inspirations when we created Albumentations, but maintainers of imgaug ceased its support which caused inconsistencies in library versions. It was done in 2021, say commit ba44eff by @Dipet .
But, somehow, we are cutting this dependency only in 2024.
- Added typing in all of the codebase. When we started the library, Python 2 was still widely used; hence, none of the original codebases had types specified for function arguments and return types. Since the end of the support for Python 2, we added types to the new or updated code, but only now have we covered all the codebase.
New transform
![Screenshot 2024-02-17 at 13 09 01](https://private-user-images.githubusercontent.com/5481618/305670342-18aaebad-4b58-4cc6-932f-e2d8a1f352ab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4MjE2NzQsIm5iZiI6MTczOTgyMTM3NCwicGF0aCI6Ii81NDgxNjE4LzMwNTY3MDM0Mi0xOGFhZWJhZC00YjU4LTRjYzYtOTMyZi1lMmQ4YTFmMzUyYWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMTk0MjU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWQyZDZjMzBhMDYxN2M3MDgzN2U1ZWQ5YThjMDg1ZTk0M2Q1ZjQ1NDdkYjhkNzU2MjQ0YzVjZDc3OWI4ZjhlZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.SyER4cDDLWEloyfgBpUt7uLyv8N1O36fMqc27RkxGzg)
- Added
XYMasking
transform: applies masking strips to an image, either horizontally (X axis) or vertically (Y axis), simulating occlusions. This transform is helpful for training models to recognize images with varied visibility conditions. It's particularly effective for spectrogram images, allowing spectral and frequency masking to improve model robustness.
As other dropout transforms CoarseDropout, MaskDropout, GridDropout it supports images, masks and keypoints as targets. (004fabb by @ternaus )
Backward Incompatible Changes
The deprecated code, including 15 transforms, was removed.
Dependency on the imgaug library was removed.
Deleted Transforms
JpegCompression
. Use ImageCompression instead.RandomBrightness
. Use RandomBrigtnessContrast instead.RandomContrast
. Use RandomBrigtnessContrast instead.Cutout
. Use CoarseDropout instead.ToTensor
. Use ToTensorV2 instead.IAAAdditiveGaussianNoise
. Use GaussNoise instead.IAAAffine
. Use Affine instead.- IAACropAndPad. Use CropAndPad instead.
IAAEmboss
. Use Emboss instead.IAAFliplr
. Use HorizontalFlip instead.IAAFlipud
. Use VerticalFlip instead.IAAPerspective
. Use Perspective instead.IAAPiecewiseAffine
. Use PiecewiseAffine instead.IAASharpen
. Use Sharpen instead.IAASuperpixels
. Use Superpixels instead.
Other deprecated functionality
- Removed
eps
parameter in RandomGamma - Removed
lambda_transforms
inserialization.from_dict
function.
Minor changes and Bug Fixes
- Added details Contributor's guide
- Added support for
matrix=None
case for Piecewise affine transform (c70e664 @Dipet ) - Bugfix - Eliminated the possibility of the Perspective transform collapsing (a919a77 @alicangok )
- Fixes in docstrings (@domef, @aaronzs, @Dipet, @ternaus )
- Added checks for python 3.12