【问题标题】:How to use ImageDataGenerator with my own set of images for image augmentation如何使用 ImageDataGenerator 和我自己的图像集进行图像增强
【发布时间】:2017-07-25 07:17:34
【问题描述】:

来自here 它展示了如何使用现有图像集 cifar10 进行图像增强。

如何使用我自己的一组图像创建ImageDataGenerator

【问题讨论】:

    标签: python machine-learning neural-network deep-learning keras


    【解决方案1】:

    您可以将您的 train_generator 更改为 flow_from_directory() 并简单地指向您选择的图像目录:

    train_generator = train_datagen.flow_from_directory(
        'your/data/here',
        target_size=(150, 150),
        batch_size=32,
        class_mode='binary')
    

    您需要将图像按类别放在子文件夹中,即your/data/here/class1your/data/here/class2 等。

    Keras 文档here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-30
      • 2018-04-14
      • 2015-04-24
      • 1970-01-01
      • 2019-12-09
      • 2020-03-09
      • 1970-01-01
      相关资源
      最近更新 更多