#NEWLINE# @ labeller_func ( group_label = 'pose_lsp_14' ) #NEWLINE# def pose_lsp_14_to_pose_lsp_14( pcloud ) : #NEWLINE# #INDENT# '\n    Apply the lsp 14-point semantic labels.\n\n    The semantic labels applied are as follows:\n\n      - left_leg\n      - right_leg\n      - left_arm\n      - right_arm\n      - head\n\n    References\n    ----------\n    .. [1] http://www.comp.leeds.ac.uk/mat4saj/lsp.html\n    ' #NEWLINE# from menpo.shape import PointUndirectedGraph #NEWLINE# n_expected_points = 14 #NEWLINE# validate_input ( pcloud , n_expected_points ) #NEWLINE# left_leg_indices = np . arange ( 0 , 3 ) #NEWLINE# right_leg_indices = np . arange ( 3 , 6 ) #NEWLINE# left_arm_indices = np . arange ( 6 , 9 ) #NEWLINE# right_arm_indices = np . arange ( 9 , 12 ) #NEWLINE# head_indices = np . arange ( 12 , 14 ) #NEWLINE# left_leg_connectivity = connectivity_from_array ( left_leg_indices ) #NEWLINE# right_leg_connectivity = connectivity_from_array ( right_leg_indices ) #NEWLINE# left_arm_connectivity = connectivity_from_array ( left_arm_indices ) #NEWLINE# right_arm_connectivity = connectivity_from_array ( right_arm_indices ) #NEWLINE# head_connectivity = connectivity_from_array ( head_indices ) #NEWLINE# all_connectivity = np . vstack ( [ left_leg_connectivity , right_leg_connectivity , left_arm_connectivity , right_arm_connectivity , head_connectivity ] ) #NEWLINE# new_pcloud = PointUndirectedGraph . init_from_edges ( pcloud . points , all_connectivity ) #NEWLINE# mapping = OrderedDict ( ) #NEWLINE# mapping [ 'left_leg' ] = left_leg_indices #NEWLINE# mapping [ 'right_leg' ] = right_leg_indices #NEWLINE# mapping [ 'left_arm' ] = left_arm_indices #NEWLINE# mapping [ 'right_arm' ] = right_arm_indices #NEWLINE# mapping [ 'head' ] = head_indices #NEWLINE# return ( new_pcloud , mapping )