Paste

class dragon.vm.dali.ops.Paste(
  n_channels=3,
  fill_value=0.0, 0.0, 0.0,
  ratio=None,
  paste_x=None,
  paste_y=None,
  **kwargs
)[source]

Copy image into a larger canvas.

Examples:

paste = dali.ops.Paste(
    # The image channels
    n_channels=3,
    # Historical values before mean subtraction
    fill_value=(102., 115., 122.),
)
paste_pos = dali.ops.Uniform((0., 1.))
paste_ratio = dali.ops.Uniform((0., 3.))
paste_prob = dali.ops.CoinFlip(0.5)

y = paste(
    inputs['x'],
    # Expand ratio
    ratio=paste_ratio() * paste_prob() + 1.,
    # PosX, PosY
    paste_x=paste_pos(),
    paste_y=paste_pos(),
)

__new__

static Paste.__new__(
  cls,
  n_channels=3,
  fill_value=0.0, 0.0, 0.0,
  ratio=None,
  paste_x=None,
  paste_y=None,
  **kwargs
)[source]

Create a Paste operator.

Parameters:
  • n_channels (int, optional, default=3) – The image channels.
  • fill_value (Sequence[number], optional) – The value(s) to fill for the canvas.
  • ratio (int, optional) – The expand ratio.
  • paste_x (int, optional) – The paste position at x-axis.
  • paste_y (int, optional) – The paste position at y-axis.
Returns:

nvidia.dali.ops.Paste – The operator.