mks0601 / 3DMPPE_POSENET_RELEASE

Official PyTorch implementation of "Camera Distance-aware Top-down Approach for 3D Multi-person Pose Estimation from a Single RGB Image", ICCV 2019
MIT License
807 stars 147 forks source link

Keypoints probability #118

Open ghost opened 2 years ago

ghost commented 2 years ago

How can I get the probability of pose_3d? I find vis_kps[2,:] that always equals one in the demo.py.

mks0601 commented 2 years ago

You can extract activation from heatmaps at the position of coord_out in the line of here

ghost commented 2 years ago

Thanks for your reply. I think Coord_out means the position of x y and z. If I want to get each probability of key points I need to calculate from heatmaps not coord_out?

mks0601 commented 2 years ago

x = coord_out[:,:,0] / cfg.output_shape[1] 2 - 1 y = coord_out[:,:,1] / cfg.output_shape[0] 2 - 1 z = coord_out[:,:,2] / cfg.depth_dim * 2 - 1 xyz = torch.stack((x,y,z),2) prob = [] for j in range(xyz.shape[1]): tab prob_j = F.grid_sample(heatmaps[:,j,None,:,:,:], xyz[:,j,None,None,None,:])[:,:,0,0,0] # N, 1 tab prob.append(prob_j) prob = torch.cat(prob,1) # N, J

might work