tjiiv-cprg / EPro-PnP

[CVPR 2022 Oral, Best Student Paper] EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Points for Monocular Object Pose Estimation
https://www.youtube.com/watch?v=TonBodQ6EUU
Apache License 2.0
1.1k stars 105 forks source link

code issue in EPro-PnP-6DoF #71

Open XiaoHaoPan opened 1 year ago

XiaoHaoPan commented 1 year ago

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 commented 1 year ago

hi! you may be looking for this

https://github.com/tjiiv-cprg/EPro-PnP/blob/5ee1525e2822517e4a6909859ea6a4d1daa032b7/EPro-PnP-6DoF/lib/test.py#L227-L229

XiaoHaoPan commented 1 year ago

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 commented 1 year ago

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.