美文网首页
几种数据增广神器介绍

几种数据增广神器介绍

作者: 小小杨树 | 来源:发表于2021-10-08 21:51 被阅读0次

    imgaug

    机器学习避免不了数据增广,数据增广种的一大法宝神器莫过于imgaug的使用。
    imgaug的使用大大的降低了我们进行数据扩增的速度,提高工作效率。
    常见的数据增广的类型:


    image.png

    上述种常见的有
    19类,在这19类种,每一大类中还有若干小类,足够大家进行数据增广,也可以选择适配自己的增广方式:
    例如:


    image.png

    augmenters.meta

    例举:

    Sequential

    List augmenter that may contain other augmenters to apply in sequence or random order.

    API link: Sequential

    Example. Apply in predefined order:

    <pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; font-size: 12px; white-space: pre; margin: 0px; padding: 12px; display: block; overflow: auto; line-height: 1.4;">import imgaug.augmenters as iaa
    aug = iaa.Sequential([
    iaa.Affine(translate_px={"x":-40}),
    iaa.AdditiveGaussianNoise(scale=0.1*255)
    ])
    </pre>

    Sequential

    Example. Apply in random order (note that the order is sampled once per batch and then the same for all images within the batch):

    <pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; font-size: 12px; white-space: pre; margin: 0px; padding: 12px; display: block; overflow: auto; line-height: 1.4;">aug = iaa.Sequential([
    iaa.Affine(translate_px={"x":-40}),
    iaa.AdditiveGaussianNoise(scale=0.1*255)
    ], random_order=True)
    </pre>

    Sequential with random order

    参考学习网站:https://imgaug.readthedocs.io/en/latest/source/overview/geometric.html
    ————————————————————————————————————————————————————————
    ————————————————————————————————————————————————————————

    albumentations

    地址:https://albumentations.readthedocs.io/en/latest/

    albumentations

    albumentations is a fast image augmentation library and easy to use wrapper around other libraries.

    Features

    • Great fast augmentations based on highly-optimized OpenCV library.
    • Super simple yet powerful interface for different tasks like (segmentation, detection, etc).
    • Easy to customize.
    • Easy to add other frameworks.

    Project info

    image.png

    ————————————————————————————————————————————————————————
    ————————————————————————————————————————————————————————

    Augmentor

    地址:https://augmentor.readthedocs.io/en/master/index.html

    Augmentor 是用于图像增强的软件包,重点是提供通常用于为机器学习问题生成图像数据的操作。

    原则上,Augmentor 由许多用于标准图像处理功能的Rotate类组成,例如类或Crop类。您可以使用大量便利函数来交互和使用这些类,这些函数涵盖了为机器学习问题扩充图像数据集时可能需要的大部分函数。

    由于图像增强通常是一个多阶段过程,因此 Augmentor 使用基于管道的方法,其中操作按顺序添加以生成管道。然后图像通过这个管道,其中每个操作都会在图像通过时应用于图像。

    此外,Augmentor根据用户定义的每个操作的概率值,在图像通过管道时随机地对图像应用操作。


    image.png

    ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————-————

    NVIDIA DALI

    地址:https://docs.nvidia.com/deeplearning/dali/user-guide/docs/index.html
    简介:
    NVIDIA 数据加载库 (DALI) 是一个用于数据加载和预处理以加速深度学习应用程序的库。它提供了一组高度优化的构建块,用于加载和处理图像、视频和音频数据。它可以用作流行深度学习框架中内置数据加载器和数据迭代器的便携式替代品。

    深度学习应用程序需要复杂的多阶段数据处理管道,包括加载、解码、裁剪、调整大小和许多其他增强功能。这些目前在 CPU 上执行的数据处理管道已经成为瓶颈,限制了训练和推理的性能和可扩展性。

    DALI 通过将数据预处理卸载到 GPU 来解决 CPU 瓶颈问题。此外,DALI 依赖于自己的执行引擎,旨在最大限度地提高输入管道的吞吐量。

    此外,深度学习框架有多种数据预处理实现,导致训练和推理工作流的可移植性和代码可维护性等挑战。使用 DALI 实现的数据处理管道是可移植的,因为它们可以轻松重定向到 TensorFlow、PyTorch、MXNet 和 PaddlePaddle。


    image.png

    相关文章

      网友评论

          本文标题:几种数据增广神器介绍

          本文链接:https://www.haomeiwen.com/subject/ashfoltx.html