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 bbox centroid fix #303

Merged
merged 6 commits into from
Sep 13, 2024
Merged

Add bbox centroid fix #303

merged 6 commits into from
Sep 13, 2024

Conversation

sfmig
Copy link
Contributor

@sfmig sfmig commented Sep 12, 2024

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
When loading bboxes datasets from a VIA tracks file, we stored the coordinates of the top-left corner of each bbox in the dataset. This is inconsistent with the current description in the docs (which always refer to the centroid of the bboxes), and also somewhat inconsistent with the rest of the tools we support.

Fixes #302

What does this PR do?

  • Transforms the top-left corner coordinates from the VIA tracks file into the centroid ones, before creating the movement dataset
  • Adds some tests

Opinions on the tests are particularly welcome. I aimed to reduce the circularity but not sure if there is a better way.

How has this PR been tested?

Tests pass locally and in CI.

Is this a breaking change?

No.

Does this PR require an update to the documentation?

No, but docstrings of the relevant private functions have been updated.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@sfmig sfmig marked this pull request as ready for review September 12, 2024 09:24
@sfmig sfmig requested a review from a team September 12, 2024 09:25
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.77%. Comparing base (f4f46df) to head (8bdf271).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #303   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files          14       14           
  Lines         883      884    +1     
=======================================
+ Hits          881      882    +1     
  Misses          2        2           

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

Copy link
Member

@niksirbi niksirbi left a comment

Choose a reason for hiding this comment

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

I'm happy with this to be merged as is, with 1 tiny suggestion.

The new test is a bit circular, you are right, but no better solutions come to my mind right now, and let's not overthink this.

tests/test_unit/test_load_bboxes.py Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Sep 12, 2024

@sfmig sfmig added this pull request to the merge queue Sep 13, 2024
Merged via the queue into main with commit 644c1b1 Sep 13, 2024
17 checks passed
@niksirbi niksirbi deleted the smg/fix-bboxes-centroid branch September 13, 2024 13:33
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.

Fix centroid imported from VIA file into bboxes dataset
2 participants