PairwiseProjectionsLoss
- class lightning_pose.losses.losses.PairwiseProjectionsLoss[source]
Bases:
LossPenalize projections from each pair of cameras into 3D world space.
Methods Summary
__call__(keypoints_targ_3d, ...[, stage])Call self as a function.
compute_loss(targets, predictions)remove_nans(loss, mask)Methods Documentation
- __call__(keypoints_targ_3d: Tensor, {'__torchtyping__': True, 'details': ('batch', 'num_keypoints', 3), 'cls_name': 'TensorType'}], keypoints_pred_3d: Tensor, {'__torchtyping__': True, 'details': ('batch', 'cam_pairs', 'num_keypoints', 3), 'cls_name': 'TensorType'}], keypoints_mask_3d: Tensor, {'__torchtyping__': True, 'details': ('batch', 'cam_pairs', 'num_keypoints'), 'cls_name': 'TensorType'}], stage: Literal['train', 'val', 'test'] | None = None, **kwargs) Tensor, {'__torchtyping__': True, 'details': ((),), 'cls_name': 'TensorType'}], list[dict]][source]
Call self as a function.
- compute_loss(targets: Tensor, {'__torchtyping__': True, 'details': ('batch', 'num_keypoints', 3), 'cls_name': 'TensorType'}], predictions: Tensor, {'__torchtyping__': True, 'details': ('batch', 'cam_pairs', 'num_keypoints', 3), 'cls_name': 'TensorType'}]) Tensor, {'__torchtyping__': True, 'details': ('batch', 'cam_pairs', 'num_keypoints',), 'cls_name': 'TensorType'}][source]
- remove_nans(loss: Tensor, {'__torchtyping__': True, 'details': ('batch', 'cam_pairs', 'num_keypoints'), 'cls_name': 'TensorType'}], mask: Tensor, {'__torchtyping__': True, 'details': ('batch', 'cam_pairs', 'num_keypoints'), 'cls_name': 'TensorType'}]) Tensor, {'__torchtyping__': True, 'details': ('valid_losses',), 'cls_name': 'TensorType'}][source]
- __init__(log_weight: float = 0.0, **kwargs) None[source]
- Parameters:
data_module – give losses access to data for computing data-specific loss params
epsilon – loss values below epsilon will be zeroed out
log_weight – natural log of the weight in front of the loss term in the final objective function
- __new__(**kwargs)