Fixed camera transformation

This commit is contained in:
Umesh Ramchandani 2021-02-07 16:58:35 +01:00
parent 28c4ce27fd
commit 67330df9ea
3 changed files with 7 additions and 7 deletions

View File

@ -180,7 +180,7 @@ class TorchCameraEstimate(CameraEstimate):
# camera_translation[0,2] = 5 * torch.ones(1)
camera_rotation = torch.tensor(
[[1e-5, 1e-5, 1e-5]], requires_grad=True, dtype=self.dtype, device=self.device)
[[0,0,0]], requires_grad=False, dtype=self.dtype, device=self.device)
camera_intrinsics = torch.zeros(
4, 4, dtype=self.dtype, device=self.device)
camera_intrinsics[0, 0] = 5

View File

@ -21,17 +21,17 @@ camera:
pose:
# device: cuda
lr: 0.05
optimizer: LBFGS # currently supported Adam, LBFGS
iterations: 300
optimizer: Adam # currently supported Adam, LBFGS
iterations: 100
useCameraIntrinsics: false
bodyMeanLoss:
enabled: false
weight: 0.001
bodyPrior:
enabled: false
enabled: true
weight: 2
anglePrior:
enabled: true
enabled: false
weight: 0.001
# idxWeights:
# - 0.5

View File

@ -48,7 +48,7 @@ class SimpleCamera(nn.Module):
dtype,
device,
transform_mat=cam_trans,
# camera_intrinsics=camera_int, camera_trans_rot=camera_params
camera_intrinsics=cam_int, camera_trans_rot=cam_params
), cam_trans, cam_int, cam_params
def forward(self, points):
@ -59,7 +59,7 @@ class SimpleCamera(nn.Module):
return proj_points
if self.hasCameraTransform:
proj_points = self.cam_int[:3, :3] @ self.cam_trans_rot[:3,
:] @ points.reshape(-1, 4, 1)
:] @ self.trans @ points.reshape(-1, 4, 1)
result = proj_points.squeeze(2)
denomiator = torch.zeros(points.shape[1], 3)
for i in range(points.shape[1]):