poseinterface.io.predictions_to_poseinterface#
- poseinterface.io.predictions_to_poseinterface(input_path, video_path, output_dir, *, sub_id, ses_id, cam_id)[source]#
Convert a prediction file to
poseinterfaceCOCO JSON format.This function reads predictions for a given video and writes the corresponding “video-level” COCO JSON labels in the
poseinterfaceformat, (i.e. asub-<sub_id>_ses-<ses_id>_cam-<cam_id>_videolabels.jsonfile).The output JSON file is meant to facilitate the extraction of “clip-level” labels, (i.e. files of the format
sub-<sub_id>_ses-<ses_id>_cam-<cam_id>_start-<frame_id>_dur-<n_frames>_cliplabels.json).- Parameters:
input_path (
Path|str) – Path to the predictions file. It should be one of the formats supported bymovement(see movement supported formats)video_path (
Path|str) – Path to the corresponding video file. Used to attach video metadata (resolution) to the COCO output.output_dir (
Path|str) – Path to the directory where to save the output JSON file.sub_id (
str) – Subject ID to include in the generated filenames.ses_id (
str) – Session ID to include in the generated filenames.cam_id (
str) – Camera ID to include in the generated filenames.
- Returns:
Path to the saved COCO JSON file.
- Return type:
Notes
For the full list of supported formats for the input file, see movement supported formats.