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

Add tests for correct usage of gap-closing or frame-skip edges #127

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

DragaDoncila
Copy link
Collaborator

Proposed Change

This PR adds tests to ensure gap closing edges are loaded and evaluated correctly by existing metrics and matchers, and updates language describing graphs to include definitions and discussion of such edges.

Types of Changes

What types of changes does your code introduce? Put an x in the boxes that apply.

  • Bugfix (non-breaking change which fixes an issue)
  • New feature or enhancement
  • Documentation update
  • Tests and benchmarks
  • Maintenance (e.g. dependencies, CI, releases, etc.)

Which topics does your change affect? Put an x in the boxes that apply.

  • Loaders
  • Matchers
  • Track Errors
  • Metrics
  • Core functionality (e.g. TrackingGraph, run_metrics, cli, etc.)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the developer/contributing docs.
  • I have added tests that prove that my feature works in various situations or tests the bugfix (if appropriate).
  • I have checked that I maintained or improved code coverage.
  • I have checked the benchmarking action to verify that my changes did not adversely affect performance.
  • I have written docstrings and checked that they render correctly in the Read The Docs build (created after the PR is opened).
  • I have updated the general documentation including Metric descriptions and example notebooks if necessary.

Further Comments

Closes #115.

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ad3f68d) 85.54% compared to head (428c50d) 89.50%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
+ Coverage   85.54%   89.50%   +3.95%     
==========================================
  Files          19       19              
  Lines         927      886      -41     
==========================================
  Hits          793      793              
+ Misses        134       93      -41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DragaDoncila
Copy link
Collaborator Author

@cmalinmayor @msschwartz21 curious to get some initial feedback here on whether there's other sections/objects that we should test for compatibility with gap-closing edges, or whether there's other docs I've missed updating etc. It looks like most of our code was already implicitly handling gap closing, so this is more about enshrining it in our docs and tests.

Copy link
Collaborator

@msschwartz21 msschwartz21 left a comment

Choose a reason for hiding this comment

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

This looks like a good set of initial test cases! Should each test case also be run in the opposite direction, e.g. switching gt and pred?

For the docs, I think you made the appropriate updates in what is currently written. In #116, there will be some places to add more content about the impact of frame-skip edges.

I expected we would need some changes in TrackingGraph and associated testing, but it looks like that isn't the case since everything is passing!

tests/track_errors/test_divisions.py Outdated Show resolved Hide resolved
Comment on lines +155 to +162
G1
3_5 -- 3_6 -- -- -- 5_10
1_0 -- 1_1 -- -- -- 2_3 -- 2_4 -<
4_5 -- 4_6
G2
2_5 -- 2_6 -- -- -- 4_10
1_0 -- 1_1 -- 1_2 -- 1_3 -- 1_4 -<
3_5 -- 3_6
Copy link
Collaborator

Choose a reason for hiding this comment

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

@cmalinmayor I thought we had validation in the TrackingGraph about edges only spanning one frame, but these graphs don't seem to be causing errors and I can't find this validation in the TrackingGraph. Am I misremembering or did we drop it at some point?

Choose a reason for hiding this comment

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

I was running into the TrackingGraph validation wanting 't' for every node_id, which stemmed from my data having gaps.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@cmalinmayor I thought we had validation in the TrackingGraph about edges only spanning one frame, but these graphs don't seem to be causing errors and I can't find this validation in the TrackingGraph. Am I misremembering or did we drop it at some point?

@msschwartz21 I also thought this was in the validation but I think we actually didn't add it, perhaps on accident...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was running into the TrackingGraph validation wanting 't' for every node_id, which stemmed from my data having gaps.

@lupinthief In my current understanding of implementing tracks with gaps, we still want all nodes to have a time associated. The gaps in time are covered by the edges that skip over frames, but still connect nodes that have times (e.g. an edge from a node in time t to a node in time t+n). Can that cover your use case as well?

@lupinthief
Copy link

lupinthief commented Dec 5, 2023 via email

@DragaDoncila
Copy link
Collaborator Author

@lupinthief thanks for taking a look at this and glad to hear it should work for your use case!

I'm still not sure I understand how exactly your data is set up, and I'm curious to learn more.

it is just that the edges were determined
from a monotonic range between 'start' and 'end', while the node attributes
were assigned from the 'detections_df' which didn't have a continuous set
of timesteps leading to empty nodes.

What do empty nodes mean here? Are they nodes that had edges connecting them, but were for some reason not present in detections_df and therefore had no further attributes associated, including t? If so, what causes the discrepancy between detections_df and the nodes present in the graph?

@lupinthief
Copy link

lupinthief commented Dec 6, 2023 via email

@DragaDoncila DragaDoncila marked this pull request as ready for review December 15, 2023 00:48
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.

Feature request: supporting edges connecting non-sequential frames
5 participants