Skip to content

Format videos to poseinterface spec. Extract clip function. #39

Merged
niksirbi merged 34 commits into
mainfrom
video-utils
May 12, 2026
Merged

Format videos to poseinterface spec. Extract clip function. #39
niksirbi merged 34 commits into
mainfrom
video-utils

Conversation

@sfmig
Copy link
Copy Markdown
Member

@sfmig sfmig commented Mar 27, 2026

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

What does this PR do?

  • Added video_to_poseinterface to io module, to convert a video to poseinterface format.
    • It renames videos following spec and reencodes them if required.
  • Basic util to extract a clip and the corresponding cliplabels.json file, given a video in poseinterface format, its full video annotations in cliplabels.json format and a range of frames.
    • Exposed as entry point extract-clip

References

\

How has this PR been tested?

Tests pass locally and in CI.

Is this a breaking change?

No.

Does this PR require an update to the documentation?

Yes, docstrings.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@sfmig sfmig changed the base branch from main to auto-file-name March 27, 2026 13:57
Comment thread poseinterface/clips.py
@sfmig sfmig changed the base branch from auto-file-name to main April 1, 2026 13:58
@sfmig sfmig force-pushed the video-utils branch 2 times, most recently from 747985c to 3ade24a Compare April 1, 2026 14:24
@sfmig sfmig marked this pull request as ready for review April 1, 2026 14:51
@sfmig sfmig requested a review from niksirbi April 1, 2026 14:51
Copy link
Copy Markdown
Member

@niksirbi niksirbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sfmig.

I tried using the new functions in #40. They mostly worked, but I've stumbled on a few issues that need to be addressed before merging (see inline comments). Happy to do another round of review after we resolve these (I skipped the tests in this round).

By the way, if we want the new public functions to appear in the API references, we have to add them manually in api_index.rst (we haven't yet set up the automatic machinery we have in movement).

Comment thread poseinterface/io.py
Comment thread poseinterface/io.py Outdated
Comment thread poseinterface/io.py Outdated
Comment thread poseinterface/clips.py Outdated
Comment thread poseinterface/clips.py Outdated
Comment thread poseinterface/clips.py
Comment thread poseinterface/clips.py Outdated
Comment thread poseinterface/clips.py Outdated
Comment thread poseinterface/clips.py
@sfmig
Copy link
Copy Markdown
Member Author

sfmig commented May 12, 2026

Hi @niksirbi , thanks for the review and apologies for the delay. I believe this is now ready to go, will request a re-review now.

@sfmig sfmig requested a review from niksirbi May 12, 2026 11:59
sfmig and others added 18 commits May 12, 2026 22:47
Restore TEST_DATA_DLC_DIR/TEST_DATA_SLEAP_DIR constants, the
sub_ses_cam_ids fixture, and the updated CSV source path that were
introduced by the annotations_to_coco refactor on main but dropped
during the rebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Raise RuntimeError if ffmpeg fails to read encoding info, and widen the
return type of _get_codec_pixelformat to dict[str, str | None] to match
the upstream VideoEncodingInfo field types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Also fix cross-reference to extract_clip in the benchmark dataset spec
by using the fully qualified module path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@niksirbi niksirbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating @sfmig!

I'm happy with it as is. I've merged #26, then rebased this one to main (was painful) and pushed some very minor cosmetic changes after that.

It's good to go now!

@niksirbi niksirbi merged commit 42ac536 into main May 12, 2026
24 checks passed
@niksirbi niksirbi deleted the video-utils branch May 12, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants