Skip to content

Minor follow-up refactors for DeepLabCut integration#23

Merged
deruyter92 merged 5 commits intomainfrom
feat/deeplabcut_integration
Feb 26, 2026
Merged

Minor follow-up refactors for DeepLabCut integration#23
deruyter92 merged 5 commits intomainfrom
feat/deeplabcut_integration

Conversation

@deruyter92
Copy link
Collaborator

@deruyter92 deruyter92 commented Feb 26, 2026

Minor follow-up refactors on PR #19, for better integration with DeepLabCut.

  • Accept typed Pose2DResult as valid input for pose_3d() method, instead of separate keypoint array and image size. This is a natural addition, since the result of prepare_2d() can directly be used in pose_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.
  • Move 3D pose input validation using valid_frame_mask: instead of performing validation and masking of valid frames between prepare_2d() and pose_3d() steps in the predict() method, all validation logic is moved to pose_3d(). This means that predict(...) method becomes literally equivalent to pose_3d(prepare_2d(...).
  • An annoying (frame-by-frame) tqdm progress-bar is silenced.

@deruyter92 deruyter92 changed the title Feat/deeplabcut integration Minor follow-up refactors for DeepLabCut integration Feb 26, 2026
@deruyter92 deruyter92 requested a review from Copilot February 26, 2026 07:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Pose2DResult as input to pose_3d() method in addition to raw keypoint arrays, making the API more ergonomic
  • Move 3D pose validation and frame masking logic from predict() into pose_3d() for better separation of concerns
  • Silence frame-by-frame progress bar in DeepLabCut's superanimal_analyze_images call

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

deruyter92 and others added 3 commits February 26, 2026 08:37
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>
@deruyter92 deruyter92 requested a review from xiu-cs February 26, 2026 07:55
@deruyter92 deruyter92 marked this pull request as ready for review February 26, 2026 07:55
@xiu-cs xiu-cs assigned xiu-cs and deruyter92 and unassigned xiu-cs Feb 26, 2026
@xiu-cs
Copy link
Collaborator

xiu-cs commented Feb 26, 2026

Hi @deruyter92, this PR looks good to me. Please feel free to merge it.

@deruyter92 deruyter92 merged commit 26c33e2 into main Feb 26, 2026
5 checks passed
@deruyter92 deruyter92 deleted the feat/deeplabcut_integration branch February 26, 2026 13:34
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.

3 participants