pose_format.torch package
PyTorch-specific functionalities.
Subpackages:
- pose_format.torch.masked package
- pose_format.torch.masked.tensor module
MaskedTensorMaskedTensor.arithmetic()MaskedTensor.cuda()MaskedTensor.div()MaskedTensor.fix_nan()MaskedTensor.matmul()MaskedTensor.permute()MaskedTensor.pow_()MaskedTensor.rename()MaskedTensor.reshape()MaskedTensor.size()MaskedTensor.split()MaskedTensor.squeeze()MaskedTensor.sum()MaskedTensor.to()MaskedTensor.transpose()MaskedTensor.zero_filled()
- pose_format.torch.masked.torch module
- pose_format.torch.masked.torch_test module
TestMaskedTorchTestMaskedTorch.test_cat()TestMaskedTorch.test_not_implemented_method()TestMaskedTorch.test_stack()TestMaskedTorch.test_zeros_mask_value()TestMaskedTorch.test_zeros_tensor_shape()TestMaskedTorch.test_zeros_tensor_type_bool()TestMaskedTorch.test_zeros_tensor_type_float()TestMaskedTorch.test_zeros_tensor_value()
- pose_format.torch.masked.tensor module
MaskedTensorMaskedTensor.arithmetic()MaskedTensor.cuda()MaskedTensor.div()MaskedTensor.fix_nan()MaskedTensor.matmul()MaskedTensor.permute()MaskedTensor.pow_()MaskedTensor.rename()MaskedTensor.reshape()MaskedTensor.size()MaskedTensor.split()MaskedTensor.squeeze()MaskedTensor.sum()MaskedTensor.to()MaskedTensor.transpose()MaskedTensor.zero_filled()
- pose_format.torch.masked.torch module
- pose_format.torch.masked.torch_test module
TestMaskedTorchTestMaskedTorch.test_cat()TestMaskedTorch.test_not_implemented_method()TestMaskedTorch.test_stack()TestMaskedTorch.test_zeros_mask_value()TestMaskedTorch.test_zeros_tensor_shape()TestMaskedTorch.test_zeros_tensor_type_bool()TestMaskedTorch.test_zeros_tensor_type_float()TestMaskedTorch.test_zeros_tensor_value()
- pose_format.torch.masked.tensor module
- pose_format.torch.representation package
- pose_format.torch.representation.angle module
- pose_format.torch.representation.angle_test module
- pose_format.torch.representation.distance module
- pose_format.torch.representation.distance_test module
- pose_format.torch.representation.inner_angle module
- pose_format.torch.representation.inner_angle_test module
- pose_format.torch.representation.point_line_distance module
- pose_format.torch.representation.point_line_distance_test module
- pose_format.torch.representation.points module
Submodules
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.'
pose_format.torch.pose_representation module
Classes:
|
TorchPoseRepresentation class representing pose information using PyTorch tensors. |
- class pose_format.torch.pose_representation.TorchPoseRepresentation(header, rep_modules1=[], rep_modules2=[], rep_modules3=[])[source]
Bases:
PoseRepresentationTorchPoseRepresentation 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