在Tensorflow对象检测API中连续应用增强的正确方法是什么?

2024-06-11 07:10:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我想通过旋转90度、180度和270度来扩充数据集,并对图像的水平或垂直翻转版本应用相同的旋转。因此,一张图像总共有8张图像(4张来自原始图像旋转,4张来自翻转图像旋转)

API中只有90度旋转(random_rotation90)。所以,我想这个函数应该连续应用,以获得180度和270度的旋转。在配置文件中执行此操作的正确方法是什么

data_augmentation_options {
  random_horizontal_flip{
  }
}
data_augmentation_options {
  random_rotation90{
  }
}

据我从preprocessor.py文件了解,上述配置直接将增强应用于原始图像,在这种情况下,不会连续应用增强。那么,以下配置是否符合我的目的

data_augmentation_options {
  random_horizontal_flip{
  }
  random_rotation90{
  }
}
data_augmentation_options {
  random_horizontal_flip{
  }
  random_rotation90{
  }
  random_rotation90{
  }
}
data_augmentation_options {
  random_horizontal_flip{
  }
  random_rotation90{
  }
  random_rotation90{
  }
  random_rotation90{
  }
}
data_augmentation_options {
  random_rotation90{
  }
}
data_augmentation_options {
  random_rotation90{
  }
  random_rotation90{
  }
}
data_augmentation_options {
  random_rotation90{
  }
  random_rotation90{
  }
  random_rotation90{
  }
}

Tags: 数据方法函数图像版本apidata配置文件
1条回答
网友
1楼 · 发布于 2024-06-11 07:10:51

不,对于每个选项,数据扩充只发生一次,每个选项分别创建一个图像。因此,使用多个旋转选项无法获得所需的旋转。为此,您必须执行以下操作: 随机旋转90{ 关键点旋转排列:3 关键点旋转排列:0 关键点旋转排列:1 关键点旋转排列:2 概率:0.5 }

相关问题 更多 >