当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Python mxnet.image.CreateMultiRandCropAugmenter用法及代码示例

用法:

mxnet.image.CreateMultiRandCropAugmenter(min_object_covered=0.1, aspect_ratio_range=(0.75, 1.33), area_range=(0.05, 1.0), min_eject_coverage=0.3, max_attempts=50, skip_prob=0)

参数

  • min_object_covered(float or list of float, default=0.1) - 图像的裁剪区域必须至少包含所提供的任何边界框的这一部分。此参数的值应为非负数。在 0 的情况下,裁剪区域不需要与提供的任何边界框重叠。
  • min_eject_coverage(float or list of float, default=0.3) - 裁剪样本的最小覆盖率 w.r.t 其原始大小。有了这个约束,裁剪后具有边区域的对象将被丢弃。
  • aspect_ratio_range(tuple of floats or list of tuple of floats, default=(0.75, 1.33)) - 图像的裁剪区域必须在此范围内具有纵横比 = 宽度 /高度。
  • area_range(tuple of floats or list of tuple of floats, default=(0.05, 1.0)) - 图像的裁剪区域必须包含此范围内提供的图像的一小部分。
  • max_attempts(int or list of int, default=50) - 尝试生成指定约束的图像的裁剪/填充区域的次数。 max_attempts 失败后,返回原始图像。

辅助函数来创建多个随机裁剪增强器。

例子

>>> # An example of creating multiple random crop augmenters
>>> min_object_covered = [0.1, 0.3, 0.5, 0.7, 0.9]  # use 5 augmenters
>>> aspect_ratio_range = (0.75, 1.33)  # use same range for all augmenters
>>> area_range = [(0.1, 1.0), (0.2, 1.0), (0.2, 1.0), (0.3, 0.9), (0.5, 1.0)]
>>> min_eject_coverage = 0.3
>>> max_attempts = 50
>>> aug = mx.image.det.CreateMultiRandCropAugmenter(min_object_covered=min_object_covered,
        aspect_ratio_range=aspect_ratio_range, area_range=area_range,
        min_eject_coverage=min_eject_coverage, max_attempts=max_attempts,
        skip_prob=0)
>>> aug.dumps()  # show some details

相关用法


注:本文由纯净天空筛选整理自apache.org大神的英文原创作品 mxnet.image.CreateMultiRandCropAugmenter。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。