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 keypoints dimension to bboxes dataset #435

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

Conversation

sfmig
Copy link
Contributor

@sfmig sfmig commented Feb 24, 2025

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
I noticed we sometimes develop features thinking mostly on the pose datasets, and plan to expand things to bboxes datasets next. A good example is the napari plugin.

If our bboxes and poses datasets were more consistent (or eventually, only one dataset), we would save quite a bit of almost-duplicate work and also potentially reduce cognitive load when planning new features (we wouldn't have to think how things would behave in two different scenarios).

Some options:
1 - One option towards having a unique movement dataset could be to add a "keypoints" dimension to the bounding boxes dataset, that is always set to "centroid". This is what is proposed in this PR (but I have no particular preference, I just wanted to gauge how painful it would be to implement).

2- Another option could be to not impose strict constraints on what dimensions are required to define a movement dataset. We have discussed this before (do we have an issue? I couldn't find it), and allowed this to accommodate the views arrays

Maybe option 1 could be a first step towards unifying the datasets, and then we reduce the constraints on what dimensions are required?

Relatedly, do we see a movement dataset hold both keypoint and bboxes data? For example, with a position_keypoints, a position_bboxes_centroids and a position_bboxes_shapes array. So thinking of bbox data as a set of additional arrays, maybe like we were envisioning for the segmentation masks.

What does this PR do?
Adds a "keypoints" dimension to the bboxes dataset.

References

How has this PR been tested?

Tests pass locally and in CI.

Is this a breaking change?

Yes, the bboxes example in particular would need to be reviewed. I will wait until we decide what to do before addressing this.

Does this PR require an update to the documentation?

Yes - the documentation re movement datasets would need to be updated. I will wait until we decide what to do though.

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

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.84%. Comparing base (9c98037) to head (99b9c91).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #435   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          23       23           
  Lines        1250     1252    +2     
=======================================
+ Hits         1248     1250    +2     
  Misses          2        2           

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

@sfmig sfmig force-pushed the smg/bboxes-keypoint-dim branch from be4859d to 60be1b6 Compare February 24, 2025 19:28
@sfmig sfmig force-pushed the smg/bboxes-keypoint-dim branch from 60be1b6 to 86b2b1f Compare February 25, 2025 12:03
@sfmig sfmig marked this pull request as ready for review February 25, 2025 13:31
@sfmig sfmig requested review from niksirbi and lochhh February 25, 2025 13:31
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.

1 participant