feat: add lightweight trajectory re-identification utility#139
Open
AnandMayank wants to merge 13 commits into
Open
feat: add lightweight trajectory re-identification utility#139AnandMayank wants to merge 13 commits into
AnandMayank wants to merge 13 commits into
Conversation
…and BoxMOT-style model loading\n\n- Add reid module with motion-based re-identification\n- Refactor OSNet and TensorRT model loading to match BoxMOT approach (auto-download/cache)\n- Add unit tests for reid utility\n\nThis closes the gap for robust ID handling in long ethology recordings and improves reproducibility for all users.
Signed-off-by: Mayank Anand <anandmayank698@gmail.com>
for more information, see https://pre-commit.ci
… docstrings\n- Use super() instead of super(Class, self)\n- Avoid mutable default arguments\n- Fix long lines and other ruff issues
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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?
Current pose estimation pipelines (e.g. DLC, SLEAP) assume a fixed pool of individual IDs defined at training time. In ethology and field recordings, this assumption often breaks:
This can result in identity reuse, where different individuals are incorrectly merged into a single ID, leading to fragmented or semantically incorrect trajectories and unreliable downstream analysis.
While gap-based splitting (e.g.
split_trajectories_by_gap, see #801) provides a useful baseline, it is insufficient for long-horizon recordings, where:What does this PR do?
This PR introduces a lightweight, optional re-identification utility in
ethologythat operates as a post-processing step on existing trajectory data:split_trajectories_by_gap)The association logic is inspired by boxMOT-style multi-object tracking, in the sense that:
boxMOT itself is not introduced as a dependency — the implementation remains fully self-contained and Ethology-native.
References
How has this PR been tested?
Unit tests were run locally with
pytest, including:Is this a breaking change?
No.
This feature is optional and does not affect existing pipelines.
Does this PR require an update to the documentation?
Not strictly required.
A short usage example can be added in a follow-up PR once the API stabilizes.
Checklist