lightning_pose.data
lightning_pose.data.augmentations Module
Functions to build augmentation pipeline.
Functions
|
Create simple and flexible data transform pipeline that augments images and keypoints. |
lightning_pose.data.cameras Module
Camera geometry utilities for multi-view 2D-to-3D projection and triangulation.
Functions
|
Project 2D keypoints from each pair of cameras into 3D world space. |
|
Project 3D keypoints to 2D using camera parameters. |
Classes
Inherit Anipose camera group and add new non-jitted triangulation method for dataloaders. |
lightning_pose.data.dali Module
Data pipelines based on efficient video reading by nvidia dali package.
Architecture overview
PrepareDALI is the entry point. Its __init__ validates inputs and pre-computes
pipeline arguments for all four combinations of stage ("train", "predict") and
model type ("base", "context"). Calling the instance (__call__) builds the DALI
pipe for the requested combination and returns a ready-to-iterate LitDaliWrapper.
LitDaliWrapper extends DALIGenericIterator and converts raw DALI output into typed
UnlabeledBatchDict or MultiviewUnlabeledBatchDict instances on every __next__.
Two prediction modes
- Standard mode (no
bbox_df): DALI resizes frames to
resize_dimson the GPU. Thebboxfield of each returned batch covers the full frame (x=0, y=0, h=H, w=W).- Bbox-crop mode (
bbox_dfsupplied toPrepareDALI): DALI delivers full-resolution frames (
resize_dims=Nonein the predict pipe) so thatLitDaliWrapper._apply_bbox_cropcan crop each frame to its per-frame bounding box and resize to the originalresize_dimsusingtorch.nn.functional.interpolate. Thebboxfield of each batch contains the actual crop coordinates, so downstream code can remap predictions back to the original coordinate space.
Functions
|
Generic video reader pipeline that loads videos, resizes, augments, and normalizes. |
Classes
Typed wrapper around a DALI pipeline iterator for Lightning Pose models. |
|
Factory for DALI video-reading pipelines used during training and prediction. |
lightning_pose.data.datamodules Module
Data modules split a dataset into train, val, and test modules.
Classes
Splits a labeled dataset into train, val, and test data loaders. |
|
Data module that contains labeled and unlabled data loaders. |
lightning_pose.data.datasets Module
Dataset objects store images, labels, and functions for manipulation.
Classes
Base dataset that contains images and keypoints as (x, y) pairs. |
|
Heatmap dataset that contains the images and keypoints in 2D arrays. |
|
Heatmap dataset that contains the images and keypoints in 2D arrays from all the cameras. |
lightning_pose.data.datatypes Module
Classes to streamline data typechecking.
Classes
Return type when calling __getitem__() on BaseTrackingDataset. |
|
Return type when calling __getitem__() on HeatmapTrackingDataset. |
|
Return type when calling __getitem__() on MultiviewDataset. |
|
Return type when calling __getitem__() on MultiviewHeatmapDataset. |
|
Batch type for base labeled data. |
|
Batch type for heatmap labeled data. |
|
Batch type for multiview labeled data. |
|
Batch type for multiview heatmap labeled data. |
|
Batch type for unlabeled data. |
|
Batch type for multiview unlabeled data. |
|
Batch type for base labeled+unlabeled data. |
|
Batch type for heatmap labeled+unlabeled data. |
|
Return type when calling train/val/test_dataloader() on semi-supervised models. |
lightning_pose.data.extractor Module
Helper class to extract labeled data from a data module.
Classes
Helper class to extract all data from a data module. |
lightning_pose.data.factory Module
Factory functions to build data pipeline components from config.
Functions
|
Create simple and flexible data transform pipeline that augments images and keypoints. |
|
Create a dataset that contains labeled data. |
|
Create a data module that splits a dataset into train/val/test iterators. |
lightning_pose.data.utils Module
Dataset/data module utilities.
Functions
|
Returns the number of examples for train, val and test given split probs. |
|
Remove samples from a data array that contain nans. |
|
Simple function to count the number of frames in a video. |
|
Quickly compute number of training frames for a given dataset. |
|
Generate 2D Gaussian heatmaps from mean and sigma. |
|
Evaluate 4D heatmaps using a 3D location tensor (last dim is x, y coords). |
|
Undo an affine transform given a tensor of keypoints and the tranform matrix. |
|
Potentially undo an affine transform given a tensor of keypoints and the tranform matrix. |
|
Transform keypoints from normalized coordinates to bbox coordinates |
|
Transform keypoints from bbox coordinates to absolute frame coordinates. |
|
Transform keypoints from original frame coordinates to model input coordinates. |
|
Convert keypoints from original image coordinates to model input coordinates. |