lightning_pose.utils
lightning_pose.utils.cropzoom Module
Tools for cropping labeled frames and videos to bounding-box regions of interest.
Functions
Given model predictions, generates a bbox.csv, crops frames, and a cropped csv file. |
|
|
TODO make consistent with generate_cropped_labeled_frames |
|
Adjusts coordinates in the input CSV file either by adding or subtracting corresponding values from a bounding box CSV file. |
lightning_pose.utils.io Module
Path handling functions.
Functions
|
Given a path to a hydra output with trained model, extract the model .ckpt file. |
|
Return keypoint names from a label CSV file or from the config. |
|
Return absolute path from possibly relative path. |
|
Generate absolute path for our example toy data. |
Extract session name from video filename by removing the view name. |
|
|
Search inside a folder to find a list of videos from different sessions and views, split them up and return a list of lists like [[sess0_view0.mp4, sess0_view1.mp4, ...], [sess1_view0.mp4, sess1_view1.mp4, ...], ...] |
Gather videos to process from a single directory. |
|
Validate and normalise video paths, returning a flat or nested list of mp4 paths. |
|
|
Given the path to a center image frame, return paths of 5 context frames (n-2, n-1, n, n+1, n+2). |
|
For a list of videos from different sessions and views, split them up and return a list of lists like [[sess0_view0.mp4, sess0_view1.mp4, ...], [sess1_view0.mp4, sess1_view1.mp4, ...], ...] |
lightning_pose.utils.pca Module
PCA class to assist with computing PCA losses.
Functions
|
Convert all values in a parameter dictionary to float tensors on the given device. |
|
Reformat multiview data so each observation is a single body part across views. |
Classes
Determine the number of PCA components to keep. |
|
Find percentile value of a given loss tensor. |
|
Class to collect data from a dataloader and compute PCA params. |
lightning_pose.utils.predictions Module
Functions for predicting keypoints on labeled datasets and unlabeled videos.
Functions
|
Save predicted keypoints for a labeled dataset. |
|
Create a DLC-style three-level pandas MultiIndex for prediction DataFrames. |
|
Overlay keypoint markers on a video and write the result to disk. |
Classes
Convert batches of model outputs into a prediction dataframe. |