Skip to content

Commit f3a141c

Browse files
niksirbiclaudelochhh
authored
Update example for converting DLC project to benchmark (v2) (#49)
* Add tree utility for displaying directory structures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add frames_to_poseinterface and fix predictions output suffix Add frames_to_poseinterface utility to copy and rename frame images according to filenames in a COCO JSON file. Also fix the output filename of predictions_to_poseinterface to use _cliplabels.json suffix matching the naming convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add lightweight DLC project fixture for testing and examples Adds a minimal DLC project under tests/data/dlc/ with 2 sessions, each containing a small (100 frames) video, placeholder PNGs, and annotation/prediction CSVs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add convert_dlc_to_benchmark sphinx-gallery example Replace SWC-plusmaze_to_benchmark example with a new end-to-end example showing how to convert a DLC project to the poseinterface benchmark dataset format. Update sphinx-gallery config to execute examples, add API entries for new functions, and add jupyter and matplotlib dependencies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Pin movement>=0.16.0 and update supported Python versions to 3.12-3.14 * updated conversion example * add workflow image to the conversion example * add API reference entry for `predictions_to_poseinterface` * Fix predictions_to_poseinterface kwargs in example after rebase Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix typo * Rename frames_to_poseinterface params to input_dir/output_dir Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * temporarily try on real data and add provenance * switch back to using small fixture in example * remove duplicate prediction_to_interface entry in API index * Apply suggestions about frames_to_poseinterface Co-authored-by: Chang Huan Lo <changhuanlo@yahoo.com> * Apply suggestions about tree Co-authored-by: Chang Huan Lo <changhuanlo@yahoo.com> * Apply suggestions about simplifying tests for tree Co-authored-by: Chang Huan Lo <changhuanlo@yahoo.com> * Fix missing warnings import and add test for partial frame match Add `import warnings` to io.py (needed after review suggestion introduced `warnings.warn`), update error message match in existing test, and add a new test for the partial-match warning path. Includes minor formatting fixes from ruff-format. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Apply suggestions about gallery example Co-authored-by: Chang Huan Lo <changhuanlo@yahoo.com> * add myst target for folder structure * Suppress spurious cell output in provenance example cell The write_text() return value (byte count) was rendered as cell output by sphinx-gallery. Use capture_repr = () to suppress it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Enable always_use_bars_union for modern union type rendering Renders `Path | str` instead of `Union[Path, str]` in API docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * replace image placeholders with real images * add custom example thumbnail --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Chang Huan Lo <changhuanlo@yahoo.com>
1 parent 2e72f28 commit f3a141c

24 files changed

Lines changed: 968 additions & 139 deletions

docs/source/_static/DLC_to_poseinterface_worklow.svg

Lines changed: 5 additions & 0 deletions
Loading
19.6 KB
Loading

docs/source/api_index.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ API
22
===
33

44
io
5-
----
5+
--
66

77
.. currentmodule:: poseinterface.io
88

@@ -11,15 +11,30 @@ io
1111
:template: function.rst
1212

1313
annotations_to_poseinterface
14-
video_to_poseinterface
14+
frames_to_poseinterface
1515
predictions_to_poseinterface
16+
video_to_poseinterface
17+
1618

1719
clips
1820
-----
21+
1922
.. currentmodule:: poseinterface.clips
2023

2124
.. autosummary::
2225
:toctree: api_generated
2326
:template: function.rst
2427

2528
extract_clip
29+
30+
31+
utils
32+
-----
33+
34+
.. currentmodule:: poseinterface.utils
35+
36+
.. autosummary::
37+
:toctree: api_generated
38+
:template: function.rst
39+
40+
tree

docs/source/benchmark-dataset.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ We mark requirements with italicised *keywords* that should be interpreted as de
1717

1818
The current scope is limited to **single-animal pose estimation** from a **single camera view**. Support for multi-camera setups is planned for a future version.
1919

20+
(target-dataset-folder-structure)=
2021
## Folder structure
2122

2223
:::{note}

docs/source/conf.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
autosummary_generate = True
7777
autodoc_default_flags = ["members", "inherited-members"]
7878

79+
# sphinx-autodoc-typehints configuration
80+
always_use_bars_union = True
81+
7982
# List of patterns, relative to source directory, that match files and
8083
# directories to ignore when looking for source files.
8184
# This pattern also affects html_static_path and html_extra_path.
@@ -86,6 +89,12 @@
8689
"**/includes/**",
8790
# Auto-generated by sphinx-gallery; contains dangling refs to ignored examples
8891
"sg_execution_times.rst",
92+
# exclude .py and .ipynb files in examples generated by sphinx-gallery
93+
# this is to prevent sphinx from complaining about duplicate source files
94+
"auto_examples/*.ipynb",
95+
"auto_examples/*.py",
96+
"auto_examples/**/*.ipynb",
97+
"auto_examples/**/*.py",
8998
]
9099

91100
# -- Options for HTML output -------------------------------------------------
@@ -138,14 +147,12 @@
138147
}
139148

140149
# -- Sphinx-Gallery configuration -------------------------------------------
150+
141151
sphinx_gallery_conf = {
142152
"examples_dirs": ["../../examples"],
143153
"gallery_dirs": ["auto_examples"],
144-
# Patterns of example filenames to ignore (not built or shown in gallery).
145-
# Use this for scripts that depend on data/resources not available in CI
146-
# or on the developer's machine (e.g. files on a specific mount point).
147-
# To re-enable an example, remove its pattern from this list.
148-
"ignore_pattern": r"SWC-plusmaze_to_benchmark",
154+
"reference_url": {"poseinterface": None},
155+
"filename_pattern": "/*.py", # which files to execute before inclusion
149156
}
150157

151158
# -- linkcheck configuration -------------------------------------------------

examples/SWC-plusmaze_to_benchmark.py

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)