Batchgenerators is a deep learning data augmentation and batching library originally for medical image segmentation. Version 2 overhauls the API for composable transformations, deterministic ordering, and reduced overhead. Current version 0.3.2 (pre-1.0, breaking changes likely). Released irregularly.
pip install batchgeneratorsv2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal example: create a BatchGenerator with transforms and iterate.
Do not mix v1 and v2 imports. Rewrite code to use v2 API: from batchgeneratorsv2.generators import BatchGenerator; from batchgeneratorsv2.transforms import Compose.
Use transforms.base.AbstractTransform instead of transforms.abstract.AbstractTransform.
Use num_processes=1 for stability, or test carefully with multiprocessing.
Ensure patch_size is less than or equal to the spatial dimensions of your input data.