joint_info smpl
生成代码:
出处:https://github.com/DART-Lab-LLUI/Metrabs_PoseEstimation
def get_joint_info():
joint_names_smpl = (
'pelv,lhip,rhip,bell,lkne,rkne,spin,lank,rank,thor,ltoe,rtoe,neck,lcla,rcla,head,lsho,'
'rsho,lelb,relb,lwri,rwri,lhan,rhan')
edges_smpl = (
'rhan-rwri-relb-rsho-rcla-thor,head-neck-thor-spin-bell-pelv-rhip-rkne-rank-rtoe')
joint_info_smpl = JointInfo(joint_names_smpl, edges_smpl)
i_sel_smpl = list(range(24))
joint_info_smpl = joint_info_smpl.select_joints(i_sel_smpl)
joint_names_smplx = (
'pelv,lhip,rhip,bell,lkne,rkne,spin,lank,rank,thor,ltoe,rtoe,neck,lcla,rcla,head,'
'lsho,rsho,lelb,relb,lwri,rwri,jaw,leyehf,reyehf,lindex1,lindex2,lindex3,lmiddle1,'
'lmiddle2,lmiddle3,lpinky1,lpinky2,lpinky3,lring1,lring2,lring3,lthumb1,lthumb2,'
'lthumb3,rindex1,rindex2,rindex3,rmiddle1,rmiddle2,rmiddle3,rpinky1,rpinky2,rpinky3,'
'rring1,rring2,rring3,rthumb1,rthumb2,rthumb3,nose,reye,leye,rear,lear,lto2,lto3,lhee,'
'rto2,rto3,rhee,lthu,lindex,lmiddle,lring,lpinky,rthu,rindex,rmiddle,rring,rpinky,'
'reyebrow1,reyebrow2,reyebrow3,reyebrow4,reyebrow5,leyebrow5,leyebrow4,leyebrow3,'
'leyebrow2,leyebrow1,nose1,nose2,nose3,nose4,rnose2,rnose1,nosemiddle,lnose1,lnose2,'
'reye1,reye2,reye3,reye4,reye5,reye6,leye4,leye3,leye2,leye1,leye6,leye5,rmouth1,rmouth2,'
'rmouth3,mouthtop,lmouth3,lmouth2,lmouth1,lmouth5,lmouth4,mouthbottom,rmouth4,rmouth5,'
'rlip1,rlip2,toplip,llip2,llip1,llip3,bottomlip,rlip3')
edges_smplx = (
'rwri-relb-rsho-rcla-thor,rank-rhee,rto2-rtoe-rto3,'
'rear-reye-nose-head-jaw-neck-thor-spin-bell-pelv-rhip-rkne-rank-rtoe')
joint_info_smplx = JointInfo(joint_names_smplx, edges_smplx)
i_sel_smplx = [*range(25), 28, 43, *range(55, 67), 68, 71, 73]
joint_info_smplx = joint_info_smplx.select_joints(i_sel_smplx)
joint_info_smplx.update_names([n + '_smplx' for n in joint_info_smplx.names])
joint_names = [*joint_info_smpl.names, *joint_info_smplx.names]
edges_smplx_renumbered = [
(i + joint_info_smpl.n_joints, j + joint_info_smpl.n_joints)
for i, j in joint_info_smplx.stick_figure_edges]
edges = [*joint_info_smpl.stick_figure_edges, *edges_smplx_renumbered]
joint_info = JointInfo(joint_names, edges)
return joint_info, i_sel_smplx