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 参数互斥,并且仅用于整数输入。