poseinterface.io.split_lp_collected_data#
- poseinterface.io.split_lp_collected_data(input_path, output_dir)[source]#
Split a Lightning Pose project-level CollectedData.csv into per-session CSVs.
Lightning Pose stores labels for all sessions in a single project-level
CollectedData.csv, with full image paths (e.g.labeled-data/<session>/<image>.png) as the row index. This function splits that file into one CSV per session, each formatted as a DLC-styleCollectedData_<scorer>.csvwith a three-level row MultiIndex(top_dir, session, image). The resulting per-session files can be passed directly toposeinterface.io.annotations_to_poseinterface().- Parameters:
- Returns:
Mapping from session name to the path of the per-session CSV.
- Return type:
- Raises:
ValueError – If any row index entry cannot be parsed into exactly three path components
(top_dir, session, image).
Examples
>>> from pathlib import Path >>> from poseinterface.io import split_lp_collected_data >>> session_csvs = split_lp_collected_data( ... input_path=Path("path/to/CollectedData.csv"), ... output_dir=Path("path/to/labeled-data"), ... )