PairwiseProjectionsLossο
- class lightning_pose.losses.losses.PairwiseProjectionsLoss[source]ο
Bases:
LossPenalize projections from each pair of cameras into 3D world space.
Attributes Summary
Methods Summary
__call__(keypoints_targ_3d,Β keypoints_pred_3d)Call self as a function.
compute_loss(targets,Β predictions)remove_nans(loss)Attributes Documentation
- loss_name = 'supervised_pairwise_projections'ο
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'}], 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'}]) Tensor, {'__torchtyping__': True, 'details': ('valid_losses',), 'cls_name': 'TensorType'}][source]ο
- __init__(log_weight: float = 0.0, **kwargs) None[source]ο
Initialize PairwiseProjectionsLoss.
- Parameters:
log_weight β final weight in front of the loss term in the objective function is computed as
1.0 / (2.0 * exp(log_weight)).
- __new__(**kwargs)ο