__init__.py 808 B

12345678910111213141516171819202122232425262728
  1. from importlib.metadata import metadata
  2. try:
  3. _metadata = metadata("albumentations")
  4. __version__ = _metadata["Version"]
  5. __author__ = _metadata["Author"]
  6. __maintainer__ = _metadata["Maintainer"]
  7. except Exception: # noqa: BLE001
  8. __version__ = "unknown"
  9. __author__ = "Vladimir Iglovikov"
  10. __maintainer__ = "Vladimir Iglovikov"
  11. import os
  12. from contextlib import suppress
  13. from albumentations.check_version import check_for_updates
  14. from .augmentations import *
  15. from .core.composition import *
  16. from .core.serialization import *
  17. from .core.transforms_interface import *
  18. with suppress(ImportError):
  19. from .pytorch import *
  20. # Perform the version check after all other initializations
  21. if os.getenv("NO_ALBUMENTATIONS_UPDATE", "").lower() not in {"true", "1"}:
  22. check_for_updates()