Movements Utils

class master_thesis.utils.MovementsUtils(max_displacement, max_scaling, max_rotation)

Bases: object

Utilities class containing movement-related methods.

random_affine()
simulate_movement(x, n, affine_matrices=None)

Simulates a moving sequence of n` frames using ``frame as starting point.

Parameters
  • x – tensor of size (C,H,W) containing the first frame.

  • n (int) – number of frames of the sequence.

  • affine_matrices (torch.FloatTensor) – tensor of size (n,3,3)

  • apply. (containing the transformations to) –

Returns

Tensor of size (C,F,H,W) containing the moving sequence.

static identity_affine()
static affine_inverse(affine)
static stack_transformations(affine_matrices, t)

Stacks a set of single transformations to apply affine_grid easily.

Given a set of n independent affine_matrices and the reference frame at position t, it computes the transformation required to move from position t to […, t-1, t-2, t+1, t+2, …].

static affine2theta(param, h, w)