generate_labeled_video

lightning_pose.utils.predictions.generate_labeled_video(video_file: str, preds_df: DataFrame, output_mp4_file: str, confidence_thresh_for_vid: float, colormap: str) None[source]

Overlay keypoint markers on a video and write the result to disk.

Parameters:
  • video_file – path to the source video file.

  • preds_df – predictions DataFrame with columns indexed as (scorer, bodypart, coord) where coord is x, y, or likelihood.

  • output_mp4_file – path where the labeled video will be saved.

  • confidence_thresh_for_vid – keypoints with confidence below this value are not plotted.

  • colormap – matplotlib colormap name used to colour each keypoint.