Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@getzze
Copy link
Contributor

@getzze getzze commented Jul 28, 2022

Description

Using tracking with optical flow, similarity between frames is computed with the optical flow between the current frame and the reference frame. This is fine if the 2 frames are close in time, but it works poorly with say 20 time-steps difference, as the optical flow is poorly computed.

Instead, save the instances shifted by optical flow step by step, so the optical flow is always computed between two adjacent frames.

The save_shifted_instances argument of FlowCandidateMaker could be made accessible from the GUI, so we could switch between the 2 options.

Types of changes

  • Bugfix
  • New feature
  • Refactor / Code style update (no logical changes)
  • Build / CI changes
  • Documentation Update
  • Other (explain)

Does this address any currently open issues?

N/A

Outside contributors checklist

  • Review the guidelines for contributing to this repository
  • Read and sign the CLA and add yourself to the authors list
  • Make sure you are making a pull request against the develop branch (not main). Also you should start your branch off develop
  • Add tests that prove your fix is effective or that your feature works
  • Add necessary documentation (if appropriate)

Thank you for contributing to SLEAP!

❤️

@talmo talmo self-requested a review July 28, 2022 22:56
Copy link
Collaborator

@talmo talmo left a comment

Choose a reason for hiding this comment

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

Hi @getzze,

Thanks for the contribution! This looks like some interesting functionality and I'd be curious to see how it works in practice.

Since this is making a change to a core component within SLEAP, do you mind adding a short test to tests/nn/test_tracker_components.py?

We just want to make sure nothing strange happens with the other components and that this runs as expected.

Thanks!!

Talmo

@getzze
Copy link
Contributor Author

getzze commented Jul 29, 2022

Hi,
I made save_shifted_instance an option for the cli and the gui.

I looked at making a test but it's not so simple as testing this requires having some images to run OpenCV optical flow function on them. I cannot promise I will have time to look at it during the next month.

@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #870 (d97672b) into develop (a2d9150) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #870      +/-   ##
===========================================
+ Coverage    67.37%   67.40%   +0.03%     
===========================================
  Files          130      130              
  Lines        22091    22110      +19     
===========================================
+ Hits         14883    14903      +20     
+ Misses        7208     7207       -1     
Impacted Files Coverage Δ
sleap/gui/learning/runners.py 32.10% <100.00%> (+0.38%) ⬆️
sleap/nn/tracking.py 72.40% <100.00%> (+1.22%) ⬆️

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

@roomrys roomrys requested a review from talmo August 23, 2022 21:32
Copy link
Collaborator

@talmo talmo left a comment

Choose a reason for hiding this comment

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

lgtm

@roomrys roomrys merged commit c4409dd into talmolab:develop Aug 24, 2022
@roomrys roomrys mentioned this pull request Sep 11, 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.

3 participants