huawei-noah / noah-research

Noah Research

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[CLIFF]the problem about 2d keypoints

pppkkk611 opened this issue · comments

Hi! thank you for amazing work.
I checked #119

    points_3d = pred_output.joints
    batch_size = points_3d.shape[0]
    img_w_value = img_w[0].item()
    img_h_value = img_h[0].item() 
    camera_center = torch.tensor([[img_w_value / 2, img_h_value / 2]], device=points_3d.device)
    camera_center = camera_center.expand(batch_size, 2)
    keypoints_2d = perspective_projection(points=points_3d,
                                  rotation=torch.eye(3, device=points_3d.device).unsqueeze(0).expand(batch_size, -1, -1),
                                  translation=pred_cam_full,
                                  focal_length=focal_length,
                                  camera_center=camera_center)

visualization:
1700646556088

    points_3d = pred_output.joints
    batch_size = points_3d.shape[0]
    img_w_value = img_w[0].item()
    img_h_value = img_h[0].item() 
    camera_center = torch.tensor([[img_w_value / 2, img_h_value / 2]], device=points_3d.device)
    camera_center = camera_center.expand(batch_size, 2)
    keypoints_2d = perspective_projection(points=points_3d,
                                  rotation=torch.eye(3, device=points_3d.device).unsqueeze(0).expand(batch_size, -1, -1),
                                  translation=pred_cam_crop,
                                  focal_length=focal_length,
                                  camera_center=camera_center)

visualization:
1700646642283

translation=pred_cam_crop is in the right proportion, but not in the center
translation=pred_cam_full the key point is not in the right proportion, but in the center
I don't know how to fix it.