pose_format.torch.pose_body module

Classes:

TorchPoseBody(fps, data, confidence)

TorchPoseBody class of pose information with PyTorch tensors.

class pose_format.torch.pose_body.TorchPoseBody(fps, data, confidence)[source]

Bases: PoseBody

TorchPoseBody class of pose information with PyTorch tensors.

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

Methods:

cuda()

Move data and cofidence of tensors to GPU

flatten()

Flatten pose data along the associated confidence values.

get_points(indexes)

Get specific points from pose data.

matmul(matrix)

Matrix multiplication on pose data.

points_perspective()

Get pose data with dimensions permuted according to POINTS_DIMS.

zero_filled()

Fill invalid values with zeros.

Attributes:

tensor_reader

Parameters:
  • fps (float) –

  • data (MaskedTensor | Tensor) –

  • confidence (Tensor) –

cuda()[source]

Move data and cofidence of tensors to GPU

flatten()[source]

Flatten pose data along the associated confidence values.

Returns:

Flattened tensor containing indexes, confidence values, and data.

Return type:

torch.Tensor

get_points(indexes)[source]

Get specific points from pose data.

Parameters:

indexes (List[int]) – List of indexes specifying the points that you need.

Returns:

New TorchPoseBody instance containing specified points and associated confidence values.

Return type:

TorchPoseBody

matmul(matrix)[source]

Matrix multiplication on pose data.

Parameters:

matrix (np.ndarray) – matrix to perform multiplication with

Returns:

A new TorchPoseBody instance with results of matrix multiplication.

Return type:

TorchPoseBody

points_perspective()[source]

Get pose data with dimensions permuted according to POINTS_DIMS.

Returns:

A MaskedTensor instance with dimensions permuted for points perspective.

Return type:

MaskedTensor

tensor_reader = 'unpack_torchstr: Reader format for unpacking Torch tensors.'
zero_filled()[source]

Fill invalid values with zeros.

Returns:

TorchPoseBody instance with masked data filled with zeros.

Return type:

TorchPoseBody