talmolab / sleap

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

Limit max tracks via track-local queues #1447

Closed shrivaths16 closed 1 year ago

shrivaths16 commented 1 year ago

Description

While performing inference based tracking, the number of tracks that are generated needs to be capped in order to avoid creating multiple irrelevant/redundant tracks.

We implement a new mode of tracking here to address this by enabling track-local queues to store candidates for matching. This allows for setting the global maximum number of tracks, irrespective of how large the gaps between detections of a track are.

This also exposes that functionality to the load_model API, the CLI, and the GUI, where now superseded options such as pre-tracking culling have been removed.

Types of changes

Does this address any currently open issues?

Outside contributors checklist

Thank you for contributing to SLEAP!

:heart:

Summary by CodeRabbit

codecov[bot] commented 1 year ago

Codecov Report

Merging #1447 (0b2fdd9) into develop (64655d6) will increase coverage by 0.07%. The diff coverage is 88.52%.

@@             Coverage Diff             @@
##           develop    #1447      +/-   ##
===========================================
+ Coverage    73.04%   73.12%   +0.07%     
===========================================
  Files          134      134              
  Lines        23851    23953     +102     
===========================================
+ Hits         17423    17516      +93     
- Misses        6428     6437       +9     
Files Changed Coverage Ξ”
sleap/gui/learning/runners.py 41.89% <25.00%> (-0.20%) :arrow_down:
sleap/nn/inference.py 81.25% <40.00%> (-0.16%) :arrow_down:
sleap/nn/tracking.py 76.39% <92.92%> (+3.29%) :arrow_up:

... and 2 files with indirect coverage changes

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

coderabbitai[bot] commented 1 year ago

Walkthrough

This pull request introduces enhancements to the tracking functionality in SLEAP, including options for maximum tracking and maximum number of tracks. It also includes corresponding updates to the CLI and tests to ensure the new features work as expected.

Changes

File(s) Summary
sleap/nn/inference.py,
sleap/nn/tracking.py
Introduced enhancements to tracking functionality with options for maximum tracking and maximum number of tracks.
tests/nn/test_inference.py,
tests/nn/test_tracker_components.py,
tests/nn/test_tracking_integration.py
Added new test cases and modified existing ones to validate the new tracking features.
sleap/gui/learning/runners.py Updated the make_predict_cli_call function to handle the new tracking parameters.
docs/guides/cli.md Updated the CLI documentation to reflect the new tracking options and modifications to existing ones.

πŸ‡πŸ’»

"In the land of code where the shadows lie, A rabbit hopped forth under the cloudless sky. With a twitch of whiskers and a gleam in eye, New tracks were laid, oh how time did fly! Max tracking here, max tracks there, Tests were run with utmost care. The docs were updated, no detail spared, For the joy of coding is best when shared!" πŸŽ‰πŸ₯•

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.