pose_format.torch.pose_body module
Classes:
|
TorchPoseBody class of pose information with PyTorch tensors. |
- class pose_format.torch.pose_body.TorchPoseBody(fps, data, confidence)[source]
Bases:
PoseBodyTorchPoseBody 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.
Get pose data with dimensions permuted according to POINTS_DIMS.
Fill invalid values with zeros.
Attributes:
- Parameters:
fps (float) –
data (MaskedTensor | Tensor) –
confidence (Tensor) –
- 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:
- 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:
- points_perspective()[source]
Get pose data with dimensions permuted according to POINTS_DIMS.
- Returns:
A
MaskedTensorinstance with dimensions permuted for points perspective.- Return type:
- tensor_reader = 'unpack_torchstr: Reader format for unpacking Torch tensors.'