lightning_pose.utils
lightning_pose.utils.cropzoom Module
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. |
|
Use config file to determine if model is semi-supervised. |
|
|
|
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 [[session0_view0.mp4, session0_view1.mp4, ...], [session1_view0.mp4, session1_view1.mp4, ...], ...] |
|
Gather videos to process from a single directory. |
|
|
|
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 [[session0_view0.mp4, session0_view1.mp4, ...], [session1_view0.mp4, session1_view1.mp4, ...], ...] |
lightning_pose.utils.pca Module
PCA class to assist with computing PCA losses.
Functions
|
Reformat multiview data so each observation is a single body part across views. |
Classes
Class to collect data from a dataloader and compute PCA params. |
|
Determine the number of PCA components to keep. |
lightning_pose.utils.predictions Module
Functions for predicting keypoints on labeled datasets and unlabeled videos.
Functions
|
Save predicted keypoints for a labeled dataset. |
|
This function is deprecated. |
|
|
|
[summary] |
|
Load Lightning Pose model from checkpoint file. |
|
Helper function for creating annotated videos. Args clip xs_arr: shape T x n_joints ys_arr: shape T x n_joints mask_array: shape T x n_joints; timepoints/joints with a False entry will not be plotted dotsize: size of marker dot on labeled video colormap: matplotlib color map for markers fps: None to default to fps of original video output_video_path: video file name start_time: time (in seconds) of video start. |
|
Deprecated, use predict_video and generate_labeled_video. |
Classes
Convert batches of model outputs into a prediction dataframe. |
lightning_pose.utils.scripts Module
Helper functions to build pipeline components from config dictionary.
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. |
|
Create loss factory that orchestrates different losses during training. |
|
Create model: regression or heatmap based, supervised or semi-supervised. |
|
|
|
|
|
Compute various metrics on predictions csv file, potentially for multiple views. Saves metrics to files next to predictions file, in the convention of: {prediction_file_stem}_{metric_name}.csv. |