Update example for converting DLC project to benchmark#40
Closed
niksirbi wants to merge 50 commits into
Closed
Conversation
Co-authored-by: sfmig <33267254+sfmig@users.noreply.github.com>
Copies frame images from a source directory to a target directory, renaming them according to the filenames in a COCO JSON file. Matches source frames to target names by extracting frame numbers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Minimal DLC project structure with 2 sessions (M727755, M708154), each containing 3 placeholder PNG files (0-byte), a CollectedData CSV with dummy keypoints, a placeholder MP4 file (0-byte), and the first 100 rows of the real DLC prediction CSV. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename and rewrite the DLC-to-benchmark example to run against the lightweight test fixture, so it executes end-to-end in CI without local data dependencies. Also update docs config: remove ignore_pattern, add exclude_patterns to prevent nbsphinx/sphinx conflicts with sphinx-gallery outputs, and add matplotlib to docs dependencies (required by sphinx-gallery). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
First 100 frames extracted from the full session videos, re-encoded with libx264/crf25/superfast/yuv420p to match poseinterface encoding parameters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
86b965d to
1fde9a5
Compare
7 tasks
5 tasks
Member
Author
|
Closing this as superseded by #49 |
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.
Description
What is this PR
Why is this PR needed?
We need a working end-to-end example showing how to convert a DeepLabCut (DLC) project to the
poseinterfacebenchmark dataset format.This is both for us to actually use when converting DLC projects, and to provide a reference example to collaborators.
What does this PR do?
Warning
This is a Frankenstein branch pulling code from multiple ongoing PRs, including #26 and #39 and #45.
I created this to facilitate quick-and-dirty conversion. It will need to be rebased to
mainand cleaned up after these other PRs have been merged.tests/data/dlc/with 2 sessions, each with a small (100 frames) video, placeholder PNGs (0-byte test files), annotation CSVs, and prediction CSVs (first 100 frames, corresponding to the videos).convert_dlc_to_benchmarksphinx-gallery example that runs against the fixture. This example:annotations_to_poseinterface(from Refactorannotations_to_coco#26) for converting DLC annotations to COCO keypoints format.frames_to_poseinterfaceutility to copy and rename frame images according to filenames in a COCO .json file.video_to_poseinterface(from Format videos toposeinterfacespec. Extract clip function. #39) for re-encoding and renaming videos to our format.predictions_to_poseinterfacefunction from Convert predictions to cliplabels.json using movement #45 for converting DLC predictions csv tocliplabels.jsonformat.extract_clip(from Format videos toposeinterfacespec. Extract clip function. #39) to extract clips from the session video and the correspondingcliplabels.jsonfile, and save them in theClips/directory of the benchmark datasettreeutility function to display directory structures, with trailing/on directory names. This is called several times in the updated sphinx-gallery example to show the structure of the DLC project and the converted benchmark dataset.This is a rough schematic of the workflow illustrated by the example:
What is currently missing?
Waiting for the aforementioned 3 PRs to be reviewed and merged, so this branch can be rebased.
References
annotations_to_coco#26poseinterfacespec. Extract clip function. #39predictions_to_cocofunction #38How has this PR been tested?
python examples/convert_dlc_to_benchmark.py).make clean htmlfromdocs/.utils.treeand forio.frames_to_poseinterface.Is this a breaking change?
No.
Does this PR require an update to the documentation?
Yes. The new sphinx-gallery example (
convert_dlc_to_benchmark) is automatically rendered into the documentation gallery. The docs config has been updated to support this.The new
treeutility has been added to the API reference.Checklist: