pose_format.tensorflow package
Tools for TensorFlow compatibility.
pose_format.tensorflow subpackages
- pose_format.tensorflow.masked package
- pose_format.tensorflow.masked.tensor module
MaskedTensorMaskedTensor.arithmetic()MaskedTensor.div()MaskedTensor.fix_nan()MaskedTensor.float()MaskedTensor.gather()MaskedTensor.matmul()MaskedTensor.mean()MaskedTensor.permute()MaskedTensor.rename()MaskedTensor.reshape()MaskedTensor.size()MaskedTensor.split()MaskedTensor.sqrt()MaskedTensor.square()MaskedTensor.squeeze()MaskedTensor.std()MaskedTensor.sum()MaskedTensor.transpose()MaskedTensor.variance()MaskedTensor.zero_filled()
- pose_format.tensorflow.masked.tensor_graph_mode_test module
- pose_format.tensorflow.masked.tensor_test module
- pose_format.tensorflow.masked.tensorflow module
- pose_format.tensorflow.masked.tensorflow_test module
TestMaskedTensorflowTestMaskedTensorflow.test_cat()TestMaskedTensorflow.test_not_implemented_method()TestMaskedTensorflow.test_stack()TestMaskedTensorflow.test_zeros_mask_value()TestMaskedTensorflow.test_zeros_tensor_shape()TestMaskedTensorflow.test_zeros_tensor_type_bool()TestMaskedTensorflow.test_zeros_tensor_type_float()TestMaskedTensorflow.test_zeros_tensor_value()
- pose_format.tensorflow.masked.tensor module
- pose_format.tensorflow.representation package
- pose_format.tensorflow.representation.angle module
- pose_format.tensorflow.representation.angle_test module
- pose_format.tensorflow.representation.distance module
- pose_format.tensorflow.representation.distance_test module
- pose_format.tensorflow.representation.inner_angle module
- pose_format.tensorflow.representation.inner_angle_test module
- pose_format.tensorflow.representation.point_line_distance module
- pose_format.tensorflow.representation.point_line_distance_test module
pose_format.tensorflow.pose_body module
Classes:
|
Representation of pose body data, optimized for TensorFlow operations. |
- class pose_format.tensorflow.pose_body.TensorflowPoseBody(fps, data, confidence)[source]
Bases:
PoseBodyRepresentation of pose body data, optimized for TensorFlow operations.
Inherites from PoseBody
- Parameters:
fps (float) – The frames per second for the pose data.
data (Union[
MaskedTensor, tf.Tensor]) – The pose data.confidence (tf.Tensor) – The confidence scores for the pose data.
Methods:
Converts into TensorFlow (tf) record format
frame_dropout_given_percent(dropout_percent)Remove some frames from the data at random from pose data.
frame_dropout_normal([dropout_mean, dropout_std])Given mean and standard deviation, randomly drops out based on normal distribution.
frame_dropout_uniform([dropout_min, dropout_max])Drops randomly frames based on a given uniform distribution
from_tfrecord(tfrecord_dict)From a TensorFlow record dictionary, it creates a instance of TensorflowPoseBody
get_points(indexes)Gets and returns points from pose data based on indexes
matmul(matrix)Multiplies pose data with a given matrix.
Returns perspective transformation of pose points.
select_frames(frame_indexes)Selects and returns a subset of frames based on the frame indexes.
Return an instance with zero-filled data.
Attributes:
- as_tfrecord()[source]
Converts into TensorFlow (tf) record format
- Returns:
dictionary representation of TensorFlow (tf) record for the pose body
- Return type:
dict
- frame_dropout_given_percent(dropout_percent)[source]
Remove some frames from the data at random from pose data.
- Parameters:
dropout_percent (float) – The percentage of frames to drop.
- Returns:
A new instance with dropped frames and the selected frame indexes.
- Return type:
TensorflowPoseBody, tf.Tensor
- frame_dropout_normal(dropout_mean=0.5, dropout_std=0.1)[source]
Given mean and standard deviation, randomly drops out based on normal distribution.
- Parameters:
dropout_mean (float, optional) – The mean for the normal distribution, by default 0.5.
dropout_std (float, optional) – The standard deviation for the normal distribution, by default 0.1.
- Returns:
instance with frames dropped based on normal distribution.
- Return type:
- frame_dropout_uniform(dropout_min=0.2, dropout_max=1.0)[source]
Drops randomly frames based on a given uniform distribution
- Parameters:
dropout_min (float, optional) – minimum percentage for dropout, by default 0.2.
dropout_max (float, optional) – maximum percentage for dropout, by default 1.0.
- Returns:
Instance with frames dropped based on a uniform distribution.
- Return type:
- classmethod from_tfrecord(tfrecord_dict)[source]
From a TensorFlow record dictionary, it creates a instance of TensorflowPoseBody
- Parameters:
tfrecord_dict (dict) – Dictionary representation of TensorFlow (tf) record data.
- Returns:
An instance constructed from given TensorFlow record data
- Return type:
- get_points(indexes)[source]
Gets and returns points from pose data based on indexes
- Parameters:
indexes (List[int]) – List of point indexes to get.
- Returns:
Instance containing only the gotten points.
- Return type:
- matmul(matrix)[source]
Multiplies pose data with a given matrix.
- Parameters:
matrix (np.ndarray) – Matrix to multiply with pose data.
- Returns:
Instance with the pose data multiplied by the matrix.
- Return type:
- points_perspective()[source]
Returns perspective transformation of pose points.
- Returns:
Transformed pose data.
- Return type:
- select_frames(frame_indexes)[source]
Selects and returns a subset of frames based on the frame indexes.
- Parameters:
frame_indexes (List[int]) – List of frame indexes
- Returns:
Instance with the selected frames
- Return type:
- tensor_reader = 'unpack_tensorflowstr: The method used to read the tensor data. (Type: str)'
pose_format.tensorflow.pose_body_test module
Classes:
|
TestsCases for the |
- class pose_format.tensorflow.pose_body_test.TestTensorflowPoseBody(methodName='runTest')[source]
Bases:
TestCaseTestsCases for the
TensorflowPoseBodyclass.Methods:
Test the
zero_filledmethod ofTensorflowPoseBodyclass.- test_tf_pose_body_zero_filled_fills_in_zeros()[source]
Test the
zero_filledmethod ofTensorflowPoseBodyclass.Test constructs a
TensorflowPoseBodyinstance with specified fps, data (as a MaskedTensor), and confidence. It then callszero_filledmethod and checks if data is filled with zeros.- Raises:
AssertionError – If sum of zero-filled body data is not equal to the expected sum.
pose_format.tensorflow.pose_representation module
Classes:
|
Class for pose representations using TensorFlow tensors. |
- class pose_format.tensorflow.pose_representation.TensorflowPoseRepresentation(header, rep_modules1=[], rep_modules2=[], rep_modules3=[])[source]
Bases:
PoseRepresentationClass for pose representations using TensorFlow tensors.
Inherites from
PoseRepresentation
This class extends PoseRepresentation and provides methods for manipulating pose representations using TensorFlow tensors.
Methods:
get_points(tensor, points)Get specific points from a tensor.
group_embeds(embeds)Group embeddings (list of tensors) along the first dimension.
permute(src, shape)Permute dimensions of a tensor according to a given shape (tuple).
- Parameters:
header (PoseHeader) –
rep_modules1 (List) –
rep_modules2 (List) –
rep_modules3 (List) –
- get_points(tensor, points)[source]
Get specific points from a tensor.
- Parameters:
tensor (tf.Tensor) – Tensor.
points (List[int]) – Indices/points needed from Tensor
- Returns:
Get values from the tensor using the given indices/points
- Return type:
tf.Tensor
pose_format.tensorflow.pose_representation_test module
Classes:
|
Testcases for TensorflowPoseRepresentation class. |
- class pose_format.tensorflow.pose_representation_test.TestTensorflowPoseRepresentation(methodName='runTest')[source]
Bases:
TestCaseTestcases for TensorflowPoseRepresentation class.
Validates the functionalities associated with the Tensorflow representation of pose data, such as ensuring that input sizes, output calculations, and representations are accurate.
Methods:
Checks that the output size is correct
Checks that the shape of the returned representation is correct
Checks that the input size is correct