Skip to content

Update example for converting DLC project to benchmark#40

Closed
niksirbi wants to merge 50 commits into
mainfrom
update-dlc-to-coco-example
Closed

Update example for converting DLC project to benchmark#40
niksirbi wants to merge 50 commits into
mainfrom
update-dlc-to-coco-example

Conversation

@niksirbi
Copy link
Copy Markdown
Member

@niksirbi niksirbi commented Mar 30, 2026

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

We need a working end-to-end example showing how to convert a DeepLabCut (DLC) project to the poseinterface benchmark 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 main and cleaned up after these other PRs have been merged.

  • Adds a lightweight DLC project fixture under 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).
  • Adds the convert_dlc_to_benchmark sphinx-gallery example that runs against the fixture. This example:
  • Adds a tree utility 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.
  • Updates docs config to support sphinx-gallery execution (resolves nbsphinx conflicts, adds matplotlib dependency).

This is a rough schematic of the workflow illustrated by the example:

image

What is currently missing?

Waiting for the aforementioned 3 PRs to be reviewed and merged, so this branch can be rebased.

References

How has this PR been tested?

  • The sphinx-gallery example runs end-to-end against the test fixture (python examples/convert_dlc_to_benchmark.py).
  • The docs build successfully with make clean html from docs/.
  • Unit tests have been added for utils.tree and for io.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 tree utility has been added to the API reference.

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 and others added 21 commits April 1, 2026 16:24
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>
@niksirbi niksirbi force-pushed the update-dlc-to-coco-example branch from 86b965d to 1fde9a5 Compare April 20, 2026 15:23
@lochhh lochhh force-pushed the auto-file-name branch from 07a7290 to 5cb1b98 Compare May 8, 2026 09:45
@niksirbi niksirbi mentioned this pull request May 11, 2026
7 tasks
Base automatically changed from auto-file-name to main May 12, 2026 21:07
@niksirbi
Copy link
Copy Markdown
Member Author

Closing this as superseded by #49

@niksirbi niksirbi closed this May 13, 2026
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