matrixify

Tools to convert detected/corrected poses to matrix representations

source

compare_laplacians

 compare_laplacians (p1, p2, figure_index=0,
                     figure_type='flipped_figures', show=False)

source

get_laplacian_matrix

 get_laplacian_matrix (frame, normalized=True, show=False, figure_index=0,
                       figure_type='flipped_figures')

LAPLACIAN: compute the Delaunay triangulation between keypoints, then use the connections to build an adjacency matrix, which is then converted to its (normalized) Laplacian matrix (a single matrix that encapsulates the degree of each node and the connections between the nodes). Then you can subtract a pose’s Laplacian from another’s to get a measure of the degree of similarity or difference between them.


source

get_pose_matrix

 get_pose_matrix (frame, figure_index=0, figure_type='flipped_figures')

source

compare_poses_cosine

 compare_poses_cosine (p1, p2)

source

normalize_and_compare_poses_cosine

 normalize_and_compare_poses_cosine (p1, p2)
Details
p1
p2 Uses cosine distance

source

normalize_symmetrify_and_compare_poses_cosine

 normalize_symmetrify_and_compare_poses_cosine (p1, p2)

source

symmetrify_pose

 symmetrify_pose (frame, figure_index=0, figure_type='figures',
                  y_first=True)

source

normalize_pose

 normalize_pose (frame, figure_index=0, figure_type='figures', norm='l2',
                 y_first=True, flip_x=False, flip_y=False,
                 mirror_coco_17_left_right=False)

source

get_normalized_coords

 get_normalized_coords (frame, figure_index=0, figure_type='figures',
                        norm='l2')

source

matrixify_pose

 matrixify_pose (coords_and_confidence)

DISTANCE MATRIX: compute a pose’s L1-normed inter-keypoint distance matrix. To compare any two poses, we can measure the degree of correlation between their distance matrices via a statistical test, such as the Mantel test. XXX It’s not obvious that normalizing the matrix really makes a difference to the final correlation comparison, but it doesn’t seem to hurt, either… Note that if the pose representation has 17 keypoints, then each pose instance can be represented by a condensed distance matrix (or vector) of 136 elements.