Closed emdavis02 closed 4 months ago
The recent updates to the sleap/nn/inference.py
and corresponding test files enhance the software to handle multiple video inputs. The changes refactor the code to iterate over a list of file paths, create providers for each file, run the inference, and save the results. Enhancements include better error handling, improved metadata management, and robust testing for various scenarios.
File | Change Summary |
---|---|
sleap/nn/inference.py |
Refactored logic to handle multiple video inputs, created a provider list, managed output paths, and added provenance metadata. |
tests/nn/test_inference.py |
Added fixtures and test functions for multiple inference scenarios, including parameterized tests and handling invalid inputs. |
In the land of code where videos roam,
A rabbit worked to bring them home.
With paths aplenty and providers in tow,
Each file's secrets would soon show.
Tests were written, robust and clear,
Ensuring the code ran without fear.
🎥✨🐇 The rabbit's joy was quick to grow!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 89.16667%
with 13 lines
in your changes missing coverage. Please review.
Project coverage is 74.19%. Comparing base (
7ed1229
) to head (fb587e5
). Report is 21 commits behind head on develop.
Files | Patch % | Lines |
---|---|---|
sleap/nn/inference.py | 89.16% | 13 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Review notes from subgroup:
sleap-track
)In addition to the changes above, another comment re: supporting inputs that are multiple SLP files:
.pkg.slp
files, particularly not overwrite them. When re-saving labels that had embedded images, they'll get saved without the embedded images and will restore the source videos. If the user had embedded images, it'd be a serious data loss event to have that file get re-saved without the images. In this case, saving to a separate SLP file is the best compromise.@roomrys am I missing any other dangerzone cases?
In addition to the changes above, another comment re: supporting inputs that are multiple SLP files:
- We do want to support having multiple SLP files that have predicted poses on all frames and that the user wants to retrack only.
- We do want to support having multiple SLP files that have suggestion frames and that the user wants to generate predicted poses for, but not track.
- We do not want to overwrite SLP files in any case.
- We really do not want to mess around with
.pkg.slp
files, particularly not overwrite them. When re-saving labels that had embedded images, they'll get saved without the embedded images and will restore the source videos. If the user had embedded images, it'd be a serious data loss event to have that file get re-saved without the images. In this case, saving to a separate SLP file is the best compromise.@roomrys am I missing any other dangerzone cases?
On further assessment during subgroup: let's actually just not do multiple SLP file support.
Description
Adding an option to add a directory to
sleap-track
to allow the command to iterate through the files in the directory and run inferences on all of them.Types of changes
Does this address any currently open issues?
1777
Outside contributors checklist
Thank you for contributing to SLEAP!
:heart:
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Tests