poseinterface.clips.extract_startlabels#

poseinterface.clips.extract_startlabels(cliplabels_path, output_path=None)[source]#

Extract only the first frame’s labels from a cliplabels.json file.

Reads a *_cliplabels.json file and creates a corresponding *_startlabels.json file containing only the labels for the first frame (frame with id=0).

Parameters:
  • cliplabels_path (str | Path) – Path to the input *_cliplabels.json file.

  • output_path (str | Path | None) – Path to the output *_startlabels.json file. If None (default), it is derived from cliplabels_path by replacing _cliplabels.json with _startlabels.json.

Returns:

Path to the output *_startlabels.json file.

Return type:

Path

Raises:
  • FileNotFoundError – If the input file does not exist.

  • ValueError – If the input filename does not end with _cliplabels.json, output_path does not end with _startlabels.json, or the clip labels do not contain exactly one first-frame image (id: 0).