[CLIFF]the problem about 2d keypoints
pppkkk611 opened this issue · comments
pppkkk611 commented
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)
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)
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.