Albumentations

Latest version: v2.0.4

Safety actively analyzes 707009 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 8

1.3.1

![image](https://github.com/albumentations-team/albumentations/assets/7512250/acc2d64e-a4ea-4cec-914b-6cf612ae6058)


New augmentations
- `ToRGB` transform (1323 by kinoooshnik)
- `RandomGravel` transform (1365 by onurtore)

Minor changes
- Color parameter for `Spatter` (1305 by Andredance)
- Check for image and masks shape equality (1310 by Andredance)
- Filter out bounding boxes with width or height below parameters (1327 by jangop)
- Added `rotate_method` in `Affine` (1394 by i-aki-y)

Bugfixes
- Docs and types fixes (1314 by oguz-hanoglu, 1320 by jangop, 1379 by Dipet, 1403 by NatanBagrov, 1400 by ajinkyakhadilkar, 1343 by plashchynski)
- Fixed check when mask is ndarrray (1326 by farizrahman4u)
- Fixed keypoint detection in hole for `CoarseDropout` (1330 by domef)
- Fixed deprecated imports of `scipy.ndimage.gaussian_filter` (1311 by rbu)
- Changed the sampling procedure of circles for `RandomSunFlare` (1333 by jasonrock-a3)
- Fixed deprecationwarning in `ToSepia` transform (1397 by ifeherva)
- Fixed `skimage` deprecetions (1421 by Dipet)
- Python3.11 support fixes (1426 by Erotemic)

1.3.0

![albu_1_3_0](https://user-images.githubusercontent.com/7512250/190941180-78e7bc20-c3b3-440c-96dd-3c4b8aa88311.png)


Breaking changes
- Renamed `method` to `rotate_method` inside [`Rotate`](https://albumentations.ai/docs/api_reference/augmentations/geometric/rotate/#albumentations.augmentations.geometric.rotate.Rotate) to keep consistency between naming parameters. (1258 by Dipet, thanks to MichaelMonashev)

New augmentations
- [`RandomCropFromBorders`](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomCropFromBorders) - Crops image based on indents from image borders. (1240 by Dipet based on 476 by ZFTurbo)
- [`BBoxSafeRandomCrop`](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.BBoxSafeRandomCrop) - Crops image without loss of bboxes. Instead of [`RandomSizedBBoxSafeCrop`](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomSizedBBoxSafeCrop) this implementation do not apply resize to target size. (579 by SunQpark)
- [`Spatter`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Spatter) - Simulates corruption which can occlude a lens in the form of rain or mud. (573 by akarsakov)
- [`Defocus`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Defocus) - Imitates lens defocusing. (551 by akarsakov)
- [`ZoomBlur`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ZoomBlur) - Imitates lens blur on zoomig. (551 by akarsakov)

Bugfixes
- Fixed wrong result in [`RandomBrightnessContrast`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomBrightnessContrast) when `brightness_by_max=False`. (487 by Dipet)
- Fixed wrong bbox clipping inside [`Perspective`](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Perspective) and [`Affine`](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Affine). (1231 by Dipet)
- Fixed incorrect removal of bboxes when `min_visibility=0` or `min_visibility=1`. (616 by IlyaOvodov)
- Fixed wrong keypoint's cropping inside [`Rotate`](https://albumentations.ai/docs/api_reference/augmentations/geometric/rotate/#albumentations.augmentations.geometric.rotate.Rotate) when `crop_border=True`. (1250 by Dipet, thanks to jonkoi)
- Fixed wrong propagation of `always_apply` [`Compose`](https://albumentations.ai/docs/api_reference/core/composition/#albumentations.core.composition.Compose) children. (561 by albu)
- [RandomSunFlare](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomSunFlare) now correctly works with `src_color`, and use all three color values. (1285 by hoel-bagard)
- [RandomGamma](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomGamma) now correctly works with float `gamma_limit`. (1286 by zahragolpa)

Minor changes:
- Speeded up [`Normalize`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Normalize) in some case up to 2 times. (563 by Dipet)
- [`GridDistortion`](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.GridDistortion), [`ElasticTransform`](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.ElasticTransform) and [`OpticalDistortion`](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.OpticalDistortion) now supports bbox targets. (476, 1262 by ZFTurbo and Dipet)
- [`MotionBlur`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.MotionBlur) now supports `allow_shifted` flag. When it's value is `False` only non shifted kernels generated. (1239 by Dipet)
- Updated versions of type formatters. (1245 by ternaus)
- [`GridDistortion`](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.GridDistortion) now supports `normalized` flag. When it is set to `True` will be applied distortion inside image border. (722 by poke1024)
- Now you can describe downscale and upscale interpolation method for [`Downscale`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Downscale). This is needed to avoid interpolation artefacts. (584 by nathanhubens)
- Refactoring. Spatial transforms moved to geometric files. (1241 by ternaus)
- Refactoring. Common functions moved into `albumentations.augmentations.utils.py`. (1260 by Dipet)
- Refactoring. Blur transforms moved into `albumentations.augmentations.blur`. (1259 by Dipet)

1.2.1

![175977113-5874a3f9-515b-42d3-a01f-73297934b912(2)](https://user-images.githubusercontent.com/681989/178302569-9feda32c-aaa9-4929-a285-6242fa777cc3.jpg)

Minor changes
- [`A.Rotate`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.rotate.Rotate) and [`A.ShiftScaleRotate`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.transforms.ShiftScaleRotate) now support new rotation method for bounding boxes, `ellipse`. (1203 by victor1cea)
- [`A.Rotate`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.rotate.Rotate) now supports new argument `crop_border`. If set to True, the rotated image will be cropped as much as possible to eliminate pixel values at the edges that were not well defined after rotation. (1214 by bonlime)
- Tests that use multiprocessing now run much faster (1218 by Dipet)
- Improved type hints (1219 by Dipet )
- Fixed a deprecation warning in `match_histograms`. (1121 by BloodAxe)

Bugfixes
- [`A.CropNonEmptyMaskIfExists`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.crops.transforms.CropNonEmptyMaskIfExists) modified the first element of `masks` in-place. Now, this behavior is fixed and [`A.CropNonEmptyMaskIfExists`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.crops.transforms.CropNonEmptyMaskIfExists) doesn't do in-place modification of input masks. (1193 by ORippler).
- Albumentations now correctly serialized and desirealized `fill_value` and `mask_fill_value` parameters for [`A.GridDropout`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.dropout.grid_dropout.GridDropout). (1191 by victor1cea)
- [`A.ColorJitter`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.ColorJitter) now correctly works with [`A.ReplayCompose`](https://albumentations.ai/docs/examples/replay/). (#1199 by zakajd)
- Fixed incorrect behavior of [`A.ColorJitter`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.ColorJitter) for `np.float32` input images when `contrast` is set to 0 (previously, all values were set to 0.5 instead of using the average value).. (1207 by Dipet)
- [`A.Rotate`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.rotate.Rotate), [`A.Affine`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.transforms.Affine) and [`A.ShiftScaleRotate`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.transforms.ShiftScaleRotate) now do rotation in the same way. Fixed incorrect rotation angle for [`A.Affine`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.transforms.Affine). [`A.Rotate`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.rotate.Rotate) and [`A.ShiftScaleRotate`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.transforms.ShiftScaleRotate) now correctly rotate the keypoints 90 degrees and don't leave black lines around the edges of the image. (1091 by Dipet )

1.2.0

![New augmentations](https://user-images.githubusercontent.com/681989/173561510-78f1b3c3-5b1b-4c2a-80d9-8b4eac82ce87.png)

![New augmentations](https://user-images.githubusercontent.com/681989/173561179-971baa09-0ff0-40e8-b6d7-8b8fc9345dcb.png)

New augmentations:
- [`A.UnsharpMask`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.UnsharpMask). This transform sharpens the input image using Unsharp Masking processing and overlays the result with the original image. (1063 by zakajd)
- [`A.RingingOvershoot`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.RingingOvershoot). This transform creates ringing or overshoot artifacts by convolving the image with a 2D sinc filter. (1064 by zakajd)
- [`A.AdvancedBlur`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.AdvancedBlur). This transform blurs the input image using a Generalized Normal filter with randomly selected parameters. It also adds multiplicative noise to generated kernel before convolution. (1066 by zakajd)
- [`A.PixelDropout`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.PixelDropout). This transformation randomly replaces pixels with the passed value. (1082 by Dipet)

Bugfixes
- Fixed a problem that prevented [`A.RandomShadow`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.RandomShadow) from working with non-contiguous input. (1117 by i-aki-y)
- [`A.PadIfNeeded`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.PadIfNeeded) now works with an arbitrary number of channels. (1069 by BloodAxe)
- Fixed all `np.random` use cases to prevent identical values when using multiprocessing. (1070 by Dipet)
- The `slant` param now has an effect in [`A.RandomRain`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.RandomRain). (1179 by victor1cea)
- `translate_percent` now uses 0 as a default value in the [`A.Affine`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.transforms.Affine) transform. (1183 by victor1cea)
- [`A.SafeRotate`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.rotate.SafeRotate) no longer loses blocks and keypoints. (1109 by Dipet)
- [`A.CropAndPad`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.crops.transforms.CropAndPad) now correctly handles bboxes when `keep_size=True`. (1059 by cannon)
- [`A.RandomCrop`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.crops.transforms.RandomCrop), [`A.RandomSizedCrop`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.crops.transforms.RandomSizedCrop), and [`A.RandomSizedBBoxSafeCrop`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.crops.transforms.RandomSizedBBoxSafeCrop) now sample last pixel. (1080 by Multihuntr)

Minor changes:
- Old code is refactored, and more type hints are added (1052 by Dipet).
- [`A.Compose`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.core.composition.Compose) now warns the user if it receives a single augmentation instead of a sequence of augmentations. (1055 by Dipet)
- [`A.CoarseDropout`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.dropout.coarse_dropout.CoarseDropout) and [`A.RandomGridShuffle`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.RandomGridShuffle) now support keypoints. (1084 by BloodAxe)
- [`A.ToTensorV2`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.pytorch.transforms.ToTensorV2) now supports the `masks` target. (1097 by alessiobonfiglio)
- [`A.PadIfNeeded`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.transforms.PadIfNeeded) now supports random padding. (1160 by mys007 )
- Improved and corrected documentation: 1047 by shyn, 1164 by notplus, 1105 by i-aki-y
- Speeded up tests by removing unnecessary tests. (1188 by creafz)
- [`A.Affine`](https://albumentations.ai/docs/api_reference/full_reference/#albumentations.augmentations.geometric.transforms.Affine) now has `keep_ratio` flag. (1104 by i-aki-y)

1.1.0

![133947365-6cba891b-4537-4d97-8b84-5ac9ce908d1d](https://user-images.githubusercontent.com/681989/135614354-231e00cc-1667-40df-b3a7-f8b22a3c6a61.png)

New augmentations
- [`TemplateTransform`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.TemplateTransform). This transform allows the blending of an input image with specified templates. (572 by akarsakov )
- [`PixelDistributionAdaptation`](https://albumentations.ai/docs/api_reference/augmentations/domain_adaptation/#albumentations.augmentations.domain_adaptation.PixelDistributionAdaptation). A new domain adaptation augmentation. It fits a simple transform on both the original and reference image, transforms the original image with transform trained on this image, and performs inverse transformation using transform fitted on the reference image. See the examples of this transform in the [`qudida` repository](https://github.com/arsenyinfo/qudida#example). (959 by arsenyinfo)

Minor changes:
- [`LongestMaxSize`](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.LongestMaxSize) and [`SmallestMaxSize`](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.SmallestMaxSize) now can also accept a list of sizes as their `max_size` argument and the actual `max_size` value will be sampled randomly from this list. (930 by kmistry-wx )
- [`A.Affine`](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Affine) now accepts `mask_interpolation` as a parameter. (975 by dskkato )
- [`A.RandomRain`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomRain) now alters brightness in HSV space instead of HLS space to prevent image corruption. (990 by ErlingLie)
- Albumentations now raises `ValueError` if bbox_params is not specified and bbox transformation is called (1013 by VirajBagal)
- [`CoarseDropout`](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.CoarseDropout) can now set the height and width of holes based on the fraction of original image height and width (1014 by VirajBagal )
- [`ElasticTransform`](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.ElasticTransform) got performance optimizations. (1004 by b0nce)

Bugfixes
- Fixed a bug when [`CropNonEmptyMaskIfExists`](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.CropNonEmptyMaskIfExists) thrown an error when it was used with a keypoint even though keypoints were mentioned as a correct target. (986 by GalDude33 )
- Fixed KeyError with [`RandomCropNearBBox`](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomCropNearBBox) when it received values with `x_min <= 0` or `y_min <= 0` (993 by Dipet )

1.0.3

- Fixed problem with incorrect shape at keypoints and bboxes processors after `ToTensorV2` 963
- Fixed problems with float values in YOLO format in edge cases 958

Page 6 of 8

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.