[go: nahoru, domu]

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 centroid calculation for binary masks #605

Merged
merged 11 commits into from
Nov 16, 2023

Conversation

SkalskiP
Copy link
Collaborator

Description

Added calculate_centroids function to compute center of mass for binary mask representations. Method added to utils.py and method import added to core.py. Position enumeration updated with CENTER_OF_MASS constant. Test function is added with test cases covering different mask scenarios. Update allows for masks to carry center of mass information too, useful in object detection.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Docs

  • Docs updated? What were the changes:

Added `calculate_centroids` function to compute center of mass for binary mask representations. Method added to `utils.py` and method import added to `core.py`. `Position` enumeration updated with `CENTER_OF_MASS` constant. Test function is added with test cases covering different mask scenarios. Update allows for masks to carry center of mass information too, useful in object detection.
@SkalskiP SkalskiP self-assigned this Nov 16, 2023
@SkalskiP SkalskiP added enhancement New feature or request api:annotator Annotators labels Nov 16, 2023
pre-commit-ci bot and others added 10 commits November 16, 2023 12:59
Renamed methods to improve clarity. `get_anchor_coordinates` changed to `get_anchors_coordinates` and `calculate_centroids` changed to `calculate_masks_centroids`. Indentation for method arguments was adjusted in `core.py` and other files for better readability. Functionality remains the same, these changes are meant to improve code maintainability and readability.
…positioning' into feature/add_center_of_mass_text_positioning

# Conflicts:
#	supervision/annotators/core.py
…positioning' into feature/add_center_of_mass_text_positioning
@SkalskiP SkalskiP merged commit fe4657f into develop Nov 16, 2023
6 checks passed
@SkalskiP SkalskiP deleted the feature/add_center_of_mass_text_positioning branch January 2, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:annotator Annotators enhancement New feature or request
Projects
Status: Current Release: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant