Skip to content

1.0.0

Compare
Choose a tag to compare
@creafz creafz released this 01 Jun 11:28
81523ea

Breaking changes

  • imgaug dependency is now optional, and by default, Albumentations won't install it. This change was necessary to prevent simultaneous install of both opencv-python-headless and opencv-python (you can read more about the problem in this issue). If you still need imgaug as a dependency, you can use the pip install -U albumentations[imgaug] command to install Albumentations with imgaug.
  • Deprecated augmentation ToTensor that converts NumPy arrays to PyTorch tensors is completely removed from Albumentations. You will get a RuntimeError exception if you try to use it. Please switch to ToTensorV2 in your pipelines.

New augmentations

By default, Albumentations doesn't require imgaug as a dependency. But if you need imgaug, you can install it along with Albumentations by running pip install -U albumentations[imgaug].

Here is a table of deprecated imgaug augmentations and respective augmentations from Albumentations that you should use instead:

Old deprecated augmentation New augmentation
IAACropAndPad CropAndPad
IAAFliplr HorizontalFlip
IAAFlipud VerticalFlip
IAAEmboss Emboss
IAASharpen Sharpen
IAAAdditiveGaussianNoise GaussNoise
IAAPerspective Perspective
IAASuperpixels Superpixels
IAAAffine Affine
IAAPiecewiseAffine PiecewiseAffine

Major changes

  • Serialization logic is updated. Previously, Albumentations used the full classpath to identify an augmentation (e.g. albumentations.augmentations.transforms.RandomCrop). With the updated logic, Albumentations will use only the class name for augmentations defined in the library (e.g., RandomCrop). For custom augmentations created by users and not distributed with Albumentations, the library will continue to use the full classpath to avoid name collisions (e.g., when a user creates a custom augmentation named RandomCrop and uses it in a pipeline).

    This new logic will allow us to refactor the code without breaking serialized augmentation pipelines created using previous versions of Albumentations. This change will also reduce the size of YAML and JSON files with serialized data.

    The new serialization logic is backward compatible. You can load serialized augmentation pipelines created in previous versions of Albumentations because Albumentations supports the old format.

Bugfixes

Minor changes