docs: clarify MaskAnnotator mask requirements#2279
Merged
Borda merged 2 commits intoMay 29, 2026
Merged
Conversation
Borda
previously approved these changes
May 29, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Documentation-only change to clarify what MaskAnnotator expects in detections.mask, helping users supply correctly-shaped instance segmentation masks (or convert from common model outputs) when using the annotators docs.
Changes:
- Added an admonition note under the
MaskAnnotatorexample describing expected mask input and common conversion entry points.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2279 +/- ##
=======================================
Coverage 79% 79%
=======================================
Files 66 66
Lines 8567 8567
=======================================
Hits 6726 6726
Misses 1841 1841 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before submitting
Description
Clarifies the expected input format for
MaskAnnotatorin the annotators documentation.This PR adds a short note explaining that
MaskAnnotatorexpects instance segmentation masks indetections.mask, and that each mask should match the height and width of the image passed toannotate.Type of Change
Motivation and Context
The existing
MaskAnnotatorexample shows how to annotate detections, but it does not explicitly explain what mask format is expected. This can be confusing for new users, especially when converting predictions from model-specific outputs.This documentation update makes the expected
detections.maskinput clearer and points users toward common conversion methods such assv.Detections.from_ultralytics(...)andsv.Detections.from_inference(...).No linked issue.
Changes Made
MaskAnnotatorexampledetections.maskshould contain instance segmentation masksTesting
Commands run:
Also ran the full test suite locally earlier:
Result:
Google Colab (optional)
Not applicable for this documentation-only change.
Screenshots/Videos (optional)
Not applicable.
Additional Notes
This is a small documentation-only contribution intended to improve clarity for users working with segmentation masks.