Albumentations

Latest version: v1.4.21

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

Scan your dependencies

Page 5 of 7

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

1.0.2

1. Fixed YOLO format conversion problem when bbox greater than image by 1 pixel.
Now YOLO bbox will be converted to Albumentations format without bbox denormalization.
More info in PR: 924
2. Removed redundant search of first & last dual transform 946

1.0.1

Added position argument to [PadIfNeeded](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.PadIfNeeded) (933 by yisaienkov)

Possible values: `center` `top_left`, `top_right`, `bottom_left`, `bottom_right`, with `center` being the default value.

One possible use case for this feature is object detection where you need to pad an image to square, but you want predicted bounding boxes being equal to the bounding box of the unpadded image.

![image_padding_2](https://user-images.githubusercontent.com/681989/124466112-f2064300-dd9e-11eb-8ac2-2fba2e3b6e58.jpg)
[image source](https://www.pexels.com/photo/blue-car-driving-through-dense-green-forest-4090350/)

Page 5 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.