poseinterface.clips.extract_startlabels_s3#

poseinterface.clips.extract_startlabels_s3(s3_cliplabels_uri, output_uri=None, aws_profile=None)[source]#

Extract first frame’s labels from a cliplabels.json file on S3.

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

Parameters:
  • s3_cliplabels_uri (str) – S3 URI of the input *_cliplabels.json file in the format s3://bucket-name/path/to/file_cliplabels.json.

  • output_uri (str | None) – Optional S3 URI for the output file. If None (default), it is derived from the s3_cliplabels_uri by replacing _cliplabels.json with _startlabels.json.

  • aws_profile (str | None) – Optional AWS profile name to use for authentication. If None, uses the default AWS credentials chain.

Returns:

S3 URI of the output *_startlabels.json file.

Return type:

str

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

  • FileNotFoundError – If the input file does not exist on S3.

  • ClientError – If there are other S3 access issues (e.g. permissions).