megengine.functional.nn.warp_affine

warp_affine(inp, mat, out_shape, border_mode='replicate', border_val=0.0, format='NHWC', interp_mode='linear')[源代码]

Batched affine transform on 2D images.

参数
  • inp (Tensor) – input image.

  • mat (Tensor) – batch, 2, 3)` transformation matrix.

  • out_shape (Union[Tuple[int, int], int, Tensor]) – output tensor shape.

  • border_mode (str) – pixel extrapolation method. Default: “wrap”. Currently “constant”, “reflect”, “reflect_101”, “isolated”, “wrap”, “replicate”, “transparent” are supported.

  • border_val (float) – value used in case of a constant border. Default: 0

  • format (str) – NHWC” as default based on historical concerns, “NCHW” is also supported. Default: “NHWC”.

  • interp_mode (str) – interpolation methods. Could be “linear”, “nearest”, “cubic”, “area”. Default: “linear”.

返回类型

Tensor

返回

output tensor.

注解

Here all available options for params are listed, however it does not mean that you can use all the combinations. On different platforms, different combinations are supported.