Skip to content
New issue

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

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

Already on GitHub? # to your account

code issue in EPro-PnP-6DoF #71

Open
XiaoHaoPan opened this issue May 22, 2023 · 3 comments
Open

code issue in EPro-PnP-6DoF #71

XiaoHaoPan opened this issue May 22, 2023 · 3 comments

Comments

@XiaoHaoPan
Copy link

XiaoHaoPan commented May 22, 2023

I would like to know where is the code to get the rotation pose after getting the cc_maps in the CDPN.py, after going through the Epro_PnP forword, thanks!

cc_maps = self.rot_head_net(features) # joints.shape [bs, 1152, 64, 64]

@Lakonik
Copy link
Collaborator

Lakonik commented May 30, 2023

hi! you may be looking for this

T_vectors, R_quats = pose_opt.split([3, 4], dim=-1) # (n, [3, 4])
R_matrix = R.from_quat(R_quats[:, [1, 2, 3, 0]].cpu().numpy()).as_matrix() # (n, 3, 3)
pose_est = np.concatenate([R_matrix, T_vectors.reshape(bs, 3, 1).cpu().numpy()], axis=-1)

@XiaoHaoPan
Copy link
Author

This seems to be different from the way you get posture during training. Why?
_, _, pose_opt_plus, _, pose_sample_logweights, cost_tgt = epropnp.monte_carlo_forward( x3d, x2d, w2d, camera, cost_fun, pose_init=pose_gt, force_init_solve=True, with_pose_opt_plus=True)
The pose_gt here seems to come from pose.txt in the dataset.

@Lakonik
Copy link
Collaborator

Lakonik commented Jun 1, 2023

In training we run EPro-PnP in the monte carlo probabilistic mode, which allows the gradients to back-propagate through the probability density. At test time, probabilistic inference is not necessary, so we simply solve the conventional PnP problem using non-linear least square.

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

No branches or pull requests

2 participants