Minor follow-up refactors for DeepLabCut integration#23
Merged
deruyter92 merged 5 commits intomainfrom Feb 26, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the DeepLabCut integration to improve the API design and make the pose estimation pipeline more composable. The changes enable users to pass Pose2DResult objects directly to pose_3d() instead of unpacking them, and consolidate all 2D result validation logic into the pose_3d() method rather than splitting it between predict() and pose_3d().
Changes:
- Accept
Pose2DResultas input topose_3d()method in addition to raw keypoint arrays, making the API more ergonomic - Move 3D pose validation and frame masking logic from
predict()intopose_3d()for better separation of concerns - Silence frame-by-frame progress bar in DeepLabCut's
superanimal_analyze_imagescall
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Collaborator
|
Hi @deruyter92, this PR looks good to me. Please feel free to merge it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Minor follow-up refactors on PR #19, for better integration with DeepLabCut.
Pose2DResultas valid input forpose_3d()method, instead of separate keypoint array and image size. This is a natural addition, since the result ofprepare_2d()can directly be used inpose_3d()without unpacking. Providing unpacked keypoint array and image size is also kept as valid signature to flexibly support users that bring their own 2d keypoints.valid_frame_mask: instead of performing validation and masking of valid frames betweenprepare_2d()andpose_3d()steps in thepredict()method, all validation logic is moved topose_3d(). This means thatpredict(...)method becomes literally equivalent topose_3d(prepare_2d(...).