Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune saved shifted instances #1001

Merged
merged 3 commits into from
Oct 24, 2022
Merged

Conversation

getzze
Copy link
Contributor

@getzze getzze commented Oct 19, 2022

Following #870, memory is continuously being filled up by saved shifted instances if save_shifted_instances=True (which is always the case if using Flow tracker from the GUI before #974 was merged).

This corrects this bug by pruning the dictionary of reference instances older than track_window before tracking a new frame.

Sorry for not seeing this bug before, if you are using a version between PR #870 and #974, you can have memory issues if you use the GUI and flow tracking.

@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Merging #1001 (21fbdf5) into develop (630687b) will increase coverage by 0.01%.
The diff coverage is 90.00%.

@@             Coverage Diff             @@
##           develop    #1001      +/-   ##
===========================================
+ Coverage    66.77%   66.78%   +0.01%     
===========================================
  Files          127      127              
  Lines        21493    21503      +10     
===========================================
+ Hits         14351    14360       +9     
- Misses        7142     7143       +1     
Impacted Files Coverage Δ
sleap/nn/tracking.py 72.76% <90.00%> (+0.35%) ⬆️

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

Copy link
Collaborator

@roomrys roomrys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request to add a docstring, but otherwise looks good! Can we add a test for this section of code - I can help write this if you are ready to submit the PR, just let me know.

sleap/nn/tracking.py Outdated Show resolved Hide resolved
sleap/nn/tracking.py Show resolved Hide resolved
@getzze
Copy link
Contributor Author

getzze commented Oct 21, 2022

Thanks for reviewing the commit so fast!
I pushed the changes you proposed.
Regarding the tests, I tried to write them some time ago, but I had a hard time figuring out how to create a mock video and all...

@roomrys roomrys merged commit 5b25862 into talmolab:develop Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants