talmolab / sleap

A deep learning framework for multi-animal pose tracking.
https://sleap.ai
Other
435 stars 97 forks source link

Import DLC with uniquebodyparts, add Tracks #1562

Closed getzze closed 1 year ago

getzze commented 1 year ago

Description

Importing Deeplabcut project with multiple animals failed because:

In addition, this PR creates Tracks with the animal names (and "single" for the unique body parts), which is a new feature.

I added tests for importing Multiple animal DLC with uniquebodyparts.

Types of changes

Does this address any currently open issues?

734

Outside contributors checklist

Thank you for contributing to SLEAP!

:heart:

Summary by CodeRabbit

coderabbitai[bot] commented 1 year ago

Walkthrough

This pull request introduces significant changes to the sleap/io/format/deeplabcut.py file, enhancing the handling of tracks and instances, and improving video file detection. It also updates the corresponding tests in tests/io/test_formats.py to reflect these changes, and corrects a minor spelling error in sleap/nn/system.py.

Changes

File Summary
sleap/io/format/deeplabcut.py Introduced a tracks dictionary for better track handling, improved video file detection, and updated the read() function to add nodes from the "uniquebodyparts" field.
sleap/nn/system.py Corrected a spelling error in the summary() function.
tests/io/test_formats.py Updated test cases to reflect changes in sleap/io/format/deeplabcut.py, added a new test case test_maudlc, and removed the test_matching_adaptor function.
tests/gui/test_commands.py Updated the assertion in test_import_labels_from_dlc_folder() to expect three tracks instead of none.

🐇

In the land of code, changes are afoot,

With tracks and instances given a new look.

Video files found with greater ease,

And tests updated to put minds at peace.

A spelling error, small but keen,

In the system's summary, now pristine.

So here's to the coder, with vision so bright,

Making the codebase a sheer delight! 🎉


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume. - Additionally, enter `@coderabbitai pause` to halt the bot's ongoing reviews as any issue or review comment. To resume reviews, enter `@coderabbitai resume` as any issue or review comment.
talmo commented 1 year ago

Thanks for the contribution @getzze! Looks like there's still a failing test related to the tracks, but just ping us when you're ready for review :)

codecov[bot] commented 1 year ago

Codecov Report

Merging #1562 (bfae2dc) into develop (1e0627a) will decrease coverage by 0.01%. Report is 1 commits behind head on develop. The diff coverage is 66.66%.

@@             Coverage Diff             @@
##           develop    #1562      +/-   ##
===========================================
- Coverage    73.37%   73.36%   -0.01%     
===========================================
  Files          134      134              
  Lines        23976    24009      +33     
===========================================
+ Hits         17592    17614      +22     
- Misses        6384     6395      +11     
Files Coverage Δ
sleap/nn/system.py 42.85% <0.00%> (ø)
sleap/io/format/deeplabcut.py 81.65% <69.23%> (-3.22%) :arrow_down:

... and 3 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

getzze commented 1 year ago

@talmo all the tests pass now, it's ready for reviewing.