Skip to content

docs: clarify MaskAnnotator mask requirements#2279

Merged
Borda merged 2 commits into
roboflow:developfrom
tarunbommawar27:docs-improve-mask-annotation-example
May 29, 2026
Merged

docs: clarify MaskAnnotator mask requirements#2279
Borda merged 2 commits into
roboflow:developfrom
tarunbommawar27:docs-improve-mask-annotation-example

Conversation

@tarunbommawar27
Copy link
Copy Markdown
Contributor

Before submitting

Description

Clarifies the expected input format for MaskAnnotator in the annotators documentation.

This PR adds a short note explaining that MaskAnnotator expects instance segmentation masks in detections.mask, and that each mask should match the height and width of the image passed to annotate.

Type of Change

  • 📝 Documentation update

Motivation and Context

The existing MaskAnnotator example 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.mask input clearer and points users toward common conversion methods such as sv.Detections.from_ultralytics(...) and sv.Detections.from_inference(...).

No linked issue.

Changes Made

  • Added a note under the MaskAnnotator example
  • Clarified that detections.mask should contain instance segmentation masks
  • Mentioned common conversion paths for framework-specific model outputs

Testing

  • I have tested this code locally
  • I have added unit tests that prove my fix is effective or that my feature works
  • All new and existing tests pass

Commands run:

uv run pre-commit run --files docs/detection/annotators.md
python - <<'PY'
import supervision as sv
print("supervision import OK:", sv.__version__)
PY

Also ran the full test suite locally earlier:

uv run pytest tests -q --maxfail=1

Result:

1751 passed

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.

@tarunbommawar27 tarunbommawar27 requested a review from SkalskiP as a code owner May 28, 2026 19:11
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 28, 2026

CLA assistant check
All committers have signed the CLA.

Borda
Borda previously approved these changes May 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 MaskAnnotator example describing expected mask input and common conversion entry points.

Comment thread docs/detection/annotators.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Borda Borda added the documentation Improvements or additions to documentation label May 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79%. Comparing base (918b613) to head (7bfddcd).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Borda Borda merged commit fb02e5c into roboflow:develop May 29, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants