parse_label_csv
- lightning_pose.utils.io.parse_label_csv(csv_file: str, header_rows: list[int] | None = None) LabeledData[source]
Parse a label CSV file into a
LabeledDataobject in a single read.Reads the file exactly once and returns keypoint names, image names, coordinates, and per-keypoint visibility flags. When the file contains a
visiblecolumn per keypoint, visibility flags are returned as an int64 tensor; otherwisevisibilityisNone.This function is the single entry point for reading label files. A future
parse_label_jsonfunction for COCO.jsonformat should return the sameLabeledDatatype, allowing callers to remain format-agnostic.- Parameters:
csv_file – path to the label CSV file
header_rows – row indices that form the MultiIndex header; defaults to
[0, 1, 2]
- Returns:
LabeledDatacontaining all label information- Raises:
FileNotFoundError – if
csv_filedoes not existValueError – if any visibility value is outside
{0, 1, 2}