数据增加后数据集尺寸
在我使用数据增强之后,类似
train = ImageDataGenerator(
rotation_range=90,
width_shift_range=0.2,
height_shift_range=0.2,
zca_whitening = True,
shear_range=0.2)
test = ImageDataGenerator(rescale=1./255)
train_dataset = train.flow_from_directory("/content/drive/MyDrive/dataset",
target_size=(150, 150),
batch_size = 32,
class_mode = 'binary')
输出:
Found 327 images belonging to 2 classes.
由于327张图像是原始数据大小,在数据增加后我的培训数据集增加了吗?如果是这样,我应该如何获得新的数据集大小?
After I used the data augmentation, such like
train = ImageDataGenerator(
rotation_range=90,
width_shift_range=0.2,
height_shift_range=0.2,
zca_whitening = True,
shear_range=0.2)
test = ImageDataGenerator(rescale=1./255)
train_dataset = train.flow_from_directory("/content/drive/MyDrive/dataset",
target_size=(150, 150),
batch_size = 32,
class_mode = 'binary')
Output:
Found 327 images belonging to 2 classes.
Since 327 images are the original data size, is my training dataset increased after the data augmentation? If it is, how should I get the new dataset size?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以通过为每个班级创建和保存增强图像,然后将这些图像与原始火车集合并来增加大小。以下是我用于该称为余额的函数。您输入其中的数据框,该列列是文件膜和标签。 Filepath列包含训练图像的完整文件路径。标签是图像的相应类标签。工作目录是存储增强图像的目录。 IMG_SIZE是增强图像的大小。
yes you can increase the size by creating and saving augmented images for each class then merging those images with the original trainset. Below is a function I use for that called balance. You input into it a dataframe thathas columns filepaths and labels. The filepath column contains the full file path to the training images. labels is the corresponding class label for the image. The working direcory is the directory where the augmented images are stored. img_size is the size of the augmented images.