KeypointPCA
- class lightning_pose.utils.pca.KeypointPCA[source]
Bases:
objectClass to collect data from a dataloader and compute PCA params.
Methods Summary
__call__()Call self as a function.
compute_reprojection_error([data_arr])returns error per 2D keypoint
reproject([data_arr])Reproject a data array using the fixed pca parameters.
Methods Documentation
- compute_reprojection_error(data_arr: Tensor, {'__torchtyping__': True, 'details': ('num_samples', 'sample_dim'), 'cls_name': 'TensorType'}] | None = None) Tensor, {'__torchtyping__': True, 'details': ('num_samples', 'sample_dim_over_two',), 'cls_name': 'TensorType'}][source]
returns error per 2D keypoint
- reproject(data_arr: Tensor, {'__torchtyping__': True, 'details': ('num_samples', 'sample_dim'), 'cls_name': 'TensorType'}] | None = None) Tensor, {'__torchtyping__': True, 'details': ('num_samples', 'sample_dim',), 'cls_name': 'TensorType'}][source]
Reproject a data array using the fixed pca parameters.
This transformation is implemented as in scikit-learn https://github.com/scikit-learn/scikit-learn/blob/37ac6788c/sklearn/decomposition/_base.py#L125
- __init__(loss_type: Literal['pca_singleview', 'pca_multiview'], data_module: UnlabeledDataModule | BaseDataModule, components_to_keep: int | float | None = 0.99, empirical_epsilon_percentile: float = 90.0, mirrored_column_matches: ListConfig | list | None = None, columns_for_singleview_pca: ListConfig | list | None = None, device: Literal['cpu', 'cuda'] | device = 'cpu', centering_method: Literal['mean', 'median'] | None = None) None[source]
- __new__(**kwargs)