Non-iterative Deocders

Soft Regression

class ezflow.decoder.noniterative.soft_regression.Soft4DFlowRegression(size, max_disp=4, entropy=False, factorization=1)[source]

Applies 4D soft argmax operation to regress flow.

Parameters
  • size (List[int]) – List containing values of B, H, W

  • max_disp (int, default : 4) – Maximum displacement

  • entropy (bool, default : False) – If True, computes local and global entropy from matching cost

  • factorization (int, default : 1) – Max displacement factorization value

forward(x)[source]

Performs forward pass.

Parameters

x (torch.Tensor) – Input cost feature map of shape B x U x V x H x W

Returns

  • torch.Tensor – A tensor of shape B x C x H x W representing the flow

  • torch.Tensor – A tensor representing the local and global entropy cost

class ezflow.decoder.noniterative.soft_regression.SoftArg2DFlowRegression(max_u=3, max_v=3, operation='argmax')[source]

Applies 2D soft argmin/argmax operation to regress flow. Used in DICL (https://arxiv.org/abs/2010.14851)

Parameters
  • max_u (int, default : 3) – Maximum displacement in the horizontal direction

  • max_v (int, default : 3) – Maximum displacement in the vertical direction

  • operation (str, default : argmax) – The argmax/argmin operation for flow regression

forward(x)[source]

Performs forward pass.

Parameters

x (torch.Tensor) – Input feature map

Returns

A tensor of shape N x 2 x H x W representing the flow

Return type

torch.Tensor

Operators

class ezflow.decoder.noniterative.operators.FlowEntropy[source]

Computes entropy from matching cost

forward(x)[source]

Performs forward pass.

Parameters

x (torch.Tensor) – A tensor of shape B x U x V x H x W representing the cost

Returns

A tensor of shape B x 1 x H x W

Return type

torch.Tensor