做目标检测或分割的可以看看,AlbumentationsX 把图像和标注的增强统一了,避免随机变换错位,还能重放调试。
AlbumentationsX 是一个新的数据增强库,确保图像及其相关标注(如掩码、边界框、关键点)在增强时使用相同的随机变换。它通过将变换列表、概率、标注设置和随机种子封装在一个 Compose 对象中,每次调用只生成一次随机值并应用于所有部分。该库支持自定义变换,并能保存管线定义、展示单次调用过程及重放。示例显示其位于文件解码后、PyTorch 批处理前,由实践者决定变换是否保持标签正确。
AlbumentationsX: One Augmentation Pipeline for Images and Related Annotations
Augmentation can corrupt a training example when an image and its annotations receive different random changes. A crop must use the same coordinates for the image, mask, boxes, keypoints, stereo views, video frames, or volume. Code paths that choose these values separately can silently misalign the data. AlbumentationsX keeps the transform list, probabilities, annotation settings, and random seed in one Compose object. Each call chooses random values once and applies them to every supported part of the training example. The library keeps each object's mask, box, and label together and lets projects add their own transforms. It can also save the pipeline definition, show what happened in one call, and run that call again. The examples place Compose after files have been decoded into arrays and before PyTorch groups examples into a batch. AlbumentationsX executes the declared transforms. Practitioners still decide whether a flip, crop, color change, or other operation preserves the correct label for their task.