nvidia.dali.fn.grid_mask#

nvidia.dali.fn.grid_mask(__input, /, *, angle=0.0, bytes_per_sample_hint=[0], preserve=False, ratio=0.5, shift_x=0.0, shift_y=0.0, tile=100, device=None, name=None)#

执行 gridmask 数据增强 (https://arxiv.org/abs/2001.04086)。

以网格状方式将图像的像素置零。网格由在 x 和 y 方向上重复的正方形组成,两个方向上的间距相同。可以绕原点旋转。

支持的后端
  • ‘cpu’

  • ‘gpu’

参数:

__input (TensorList) – 算子的输入。

关键字参数:
  • angle (float 或 TensorList of float, optional, default = 0.0) – 网格旋转的角度,以弧度为单位。

  • bytes_per_sample_hint (int 或 list of int, optional, default = [0]) –

    每个样本的输出大小提示,以字节为单位。

    如果指定,则算子的输出(位于 GPU 或分页锁定主机内存中)将被预先分配以容纳此大小的样本批次。

  • preserve (bool, optional, default = False) – 即使算子的输出未使用,也阻止其从图中移除。

  • ratio (float 或 TensorList of float, optional, default = 0.5) – 黑色正方形宽度与瓦片宽度的比率。

  • shift_x (float 或 TensorList of float, optional, default = 0.0) – 平移向量的 x 分量,在旋转后应用。

  • shift_y (float 或 TensorList of float, optional, default = 0.0) – 平移向量的 y 分量,在旋转后应用。

  • tile (int 或 TensorList of int, optional, default = 100) – 单个瓦片的长度,等于黑色正方形的宽度加上它们之间的间距。