Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keypoints probability #118

Open
ghost opened this issue May 9, 2022 · 3 comments
Open

Keypoints probability #118

ghost opened this issue May 9, 2022 · 3 comments

Comments

@ghost
Copy link

ghost commented May 9, 2022

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

@mks0601
Copy link
Owner

mks0601 commented May 9, 2022

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

@ghost
Copy link
Author

ghost commented May 9, 2022

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
Copy link
Owner

mks0601 commented May 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant