Closed getzze closed 1 year ago
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
.
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! 🎉
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 :)
Merging #1562 (bfae2dc) into develop (1e0627a) will decrease coverage by
0.01%
. Report is 1 commits behind head on develop. The diff coverage is66.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
@talmo all the tests pass now, it's ready for reviewing.
Description
Importing Deeplabcut project with multiple animals failed because:
uniquebodyparts
list. Unique body parts do not belong to any individual, so parsing the .csv file containing the labeled frames leads to key error of the type: Cannot find key ("animal", "unique_body_part"). Unique body parts belong to the "single" individual.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
summary()
function, improving the readability of the code.test_maudlc
to ensure the correct parsing and organization of data from CSV files.animal_names
list with atracks
dictionary for better data management.