nvidia.dali.fn.segmentation.random_mask_pixel#

nvidia.dali.fn.segmentation.random_mask_pixel(__input, /, *, bytes_per_sample_hint=[0], foreground=0, preserve=False, seed=-1, threshold=0.0, value=None, device=None, name=None)#

在掩码中选择随机像素坐标,从均匀分布中采样。

基于运行时参数 foreground,它返回仅前景像素或任何像素。

当像素值超过给定的 threshold 或等于特定的 value 时,像素被分类为前景。

支持的后端
  • ‘cpu’

参数:

__input (TensorList) – 操作符的输入。

关键字参数:
  • bytes_per_sample_hint (int 或 list of int, 可选, 默认值 = [0]) –

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

    如果指定,则位于 GPU 或分页锁定主机内存中的操作符输出将被预先分配,以适应此大小的样本批次。

  • foreground (int 或 TensorList of int, 可选, 默认值 = 0) –

    如果值不为 0,则像素位置将从所有前景像素中均匀采样。

    如果值为 0,则像素位置将从所有可用像素中均匀采样。

  • preserve (bool, 可选, 默认值 = False) – 即使操作符的输出未使用,也阻止将其从图中删除。

  • seed (int, 可选, 默认值 = -1) – 随机种子;如果未设置,将自动分配一个。

  • threshold (float 或 TensorList of float, 可选, 默认值 = 0.0) –

    所有值高于此阈值的像素都被解释为前景。

    此参数与 value 参数互斥。

  • value (intTensorList of int, 可选) –

    所有等于此值的像素都被解释为前景。

    此参数与 threshold 参数互斥,并且旨在仅与整数输入一起使用。