mks0601 / NeuralAnnot_RELEASE

3D Pseudo-GTs of "NeuralAnnot: Neural Annotator for 3D Human Mesh Training Sets", CVPRW 2022 Oral.
173 stars 11 forks source link

Question about loss in three recipe #17

Open MooreManor opened 1 year ago

MooreManor commented 1 year ago

Hello! @mks0601

I am trying to reproduce three recipes based on Pose2Pose. I am not quite sure about the loss implementation. Is that the same as NeuralAnnot (i.e. same as below)?

loss['joint_img'] = self.coord_loss(joint_img, smpl.reduce_joint_set(targets['joint_img']), smpl.reduce_joint_set(meta_info['joint_trunc']), meta_info['is_3D'])
loss['smpl_joint_img'] = self.coord_loss(joint_img, smpl.reduce_joint_set(targets['smpl_joint_img']), smpl.reduce_joint_set(meta_info['smpl_joint_trunc']))
loss['smpl_pose'] = self.param_loss(smpl_pose, targets['smpl_pose'], meta_info['smpl_pose_valid']) # computing loss with rotation matrix instead of axis-angle can avoid ambiguity of axis-angle. current: compute loss with axis-angle. should be fixed.
loss['smpl_shape'] = self.param_loss(smpl_shape, targets['smpl_shape'], meta_info['smpl_shape_valid'][:,None])
loss['joint_proj'] = self.coord_loss(joint_proj, targets['joint_img'][:,:,:2], meta_info['joint_trunc'])
loss['joint_cam'] = self.coord_loss(joint_cam, targets['joint_cam'], meta_info['joint_valid'] * meta_info['is_3D'][:,None,None])
loss['smpl_joint_cam'] = self.coord_loss(joint_cam, targets['smpl_joint_cam'], meta_info['smpl_joint_valid'])
loss['regularizer_shape'] = self.regular_loss(smpl_shape)/100
loss['regularizer_pose'] = self.regular_loss(vposer_para)/100

where regular_loss is the regularize l2 loss (i.e. torch.pow(para,2))

Besides, original 3dpw dataset dataloader don't offer full targets like targets = {'joint_img': joint_img, 'smpl_joint_img': smpl_joint_img, 'joint_cam': joint_cam, 'smpl_joint_cam': smpl_joint_cam, 'smpl_pose': smpl_pose, 'smpl_shape': smpl_shape}. Can you offer the preprocess script to get the joint_img and joint_cam in 3dpw?