mirror of
https://github.com/gosticks/body-pose-animation.git
synced 2025-10-16 11:45:42 +00:00
Fixed camera transformation
This commit is contained in:
parent
28c4ce27fd
commit
67330df9ea
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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]):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user