Skip to content

Add Lightning Pose conversion example#56

Merged
themattinthehatt merged 5 commits into
mainfrom
lpconvert
Jun 12, 2026
Merged

Add Lightning Pose conversion example#56
themattinthehatt merged 5 commits into
mainfrom
lpconvert

Conversation

@themattinthehatt

Copy link
Copy Markdown
Collaborator

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
Current repo only contains conversion utilities for DLC projects.

What does this PR do?
Add Lightning Pose conversion: helper functions, small example dataset, and example conversion script.

References

Reuses much of the conversion utilities developed in #49.

How has this PR been tested?

  • Ran pre-commit hooks
  • Built the documentation and read the auto-generated example page
  • Ran pytest

Is this a breaking change?

No.

Does this PR require an update to the documentation?

Yes; a new example has been added at "examples/convert_lp_to_benchmark.py".

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

@themattinthehatt themattinthehatt changed the title Lpconvert add Lightning Pose conversion example May 29, 2026
@themattinthehatt themattinthehatt changed the title add Lightning Pose conversion example Add Lightning Pose conversion example May 29, 2026
@niksirbi niksirbi self-requested a review June 1, 2026 12:01

@niksirbi niksirbi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR @themattinthehatt !

Special kudos for adding that LP fixture which makes the example run reproducible.

I'm pre-approving this PR despite the inline comments I left. Consider my comments optional and feel free to address only those you think are important.

The new gallery example duplicates lots of content from the DLC example, but I think that's fine for now. The problem will improve after we introduce higher-level APIs, as discussed in #50

Comment thread examples/convert_lp_to_benchmark.py Outdated
Comment on lines +61 to +67
# Lightning Pose saves prediction files to the model output directory,
# **not** to the project's ``videos/`` directory. Before running this
# script, move (or copy) each session's prediction CSV — and apply any
# manual corrections you have made — into
# ``<source_project_dir>/videos/``, named to match the corresponding
# video stem (e.g. ``<video_stem>.csv``).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this necessary? predictions_to_poseinterface accepts separate paths for predictions and for video, so should be fine having them in separate folders, unless I'm missing something.

If it's necessary, I wonder how we could help with the copying. For example, we could include a small utility for copying predictions from the model output dir to the videos dir. Similar logic to how we include a split_lp_collected_data utility.

Let me know what you think. We could also open an issue to tackle this later after this PR is merged.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it's not strictly necessary, for now it's more just to streamline this conversion process and make the script work out-of-the-box. perhaps we revisit this once #50 has been addressed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm fine with that.

Comment thread examples/convert_lp_to_benchmark.py
Comment thread examples/convert_lp_to_benchmark.py Outdated
Comment thread examples/convert_lp_to_benchmark.py Outdated
Comment thread examples/convert_lp_to_benchmark.py
Comment thread poseinterface/io.py
Comment thread poseinterface/io.py Outdated
@themattinthehatt

Copy link
Copy Markdown
Collaborator Author

@niksirbi I addressed most of your comments, thanks for the feedback! I'm getting the same doc build failure here as in #57 - is this a movement issue?

I double-checked the build docs, everything looks good 👌

@niksirbi

Copy link
Copy Markdown
Member

@niksirbi I addressed most of your comments, thanks for the feedback! I'm getting the same doc build failure here as in #57 - is this a movement issue?

Yes, see my comment on the other PR.

@themattinthehatt themattinthehatt merged commit c64a6b1 into main Jun 12, 2026
24 checks passed
@themattinthehatt themattinthehatt deleted the lpconvert branch June 12, 2026 15:18
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