Shortcuts

mmedit.models.utils.flow_warp

Module Contents

Functions

flow_warp(x, flow[, interpolation, padding_mode, ...])

Warp an image or a feature map with optical flow.

mmedit.models.utils.flow_warp.flow_warp(x, flow, interpolation='bilinear', padding_mode='zeros', align_corners=True)[源代码]

Warp an image or a feature map with optical flow.

参数
  • x (Tensor) – Tensor with size (n, c, h, w).

  • flow (Tensor) – Tensor with size (n, h, w, 2). The last dimension is a two-channel, denoting the width and height relative offsets. Note that the values are not normalized to [-1, 1].

  • interpolation (str) – Interpolation mode: ‘nearest’ or ‘bilinear’. Default: ‘bilinear’.

  • padding_mode (str) – Padding mode: ‘zeros’ or ‘border’ or ‘reflection’. Default: ‘zeros’.

  • align_corners (bool) – Whether align corners. Default: True.

返回

Warped image or feature map.

返回类型

Tensor

Read the Docs v: latest
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.