pose_format.torch.pose_representation module

Classes:

TorchPoseRepresentation(header[, ...])

TorchPoseRepresentation class representing pose information using PyTorch tensors.

class pose_format.torch.pose_representation.TorchPoseRepresentation(header, rep_modules1=[], rep_modules2=[], rep_modules3=[])[source]

Bases: PoseRepresentation

TorchPoseRepresentation class representing pose information using PyTorch tensors.

This class extends the PoseRepresentation class and provides methods for manipulating and representing pose data using PyTorch tensors.

Parameters:
  • header (PoseHeader) – Header describing the pose data structure.

  • rep_modules1 (List) – List of additional representation modules (level 1) to apply to pose data.

  • rep_modules2 (List) – List of additional representation modules (level 2) to apply to pose data.

  • rep_modules3 (List) – List of additional representation modules (level 3) to apply to pose data.

Methods:

group_embeds(embeds)

Group and reshape embedded tensors for batch processing.

permute(src, shape)

Permute dimensions of tensor according to a specified shape (tuple).

group_embeds(embeds)[source]

Group and reshape embedded tensors for batch processing.

Parameters:

embeds (List[torch.Tensor]) – List of embedded tensors of size (embed_size, Batch, Len).

Returns:

A tensor of size (Batch, Len, embed_size) with grouped and reshaped embedded tensors.

Return type:

torch.Tensor

permute(src, shape)[source]

Permute dimensions of tensor according to a specified shape (tuple).

Parameters:
  • src (torch.Tensor) – tensor to permute

  • shape (tuple) – desired shape of the tensor after permutation.

Returns:

tensor with permuted dimensions according to specified shape.

Return type:

torch.Tensor