Repository navigation
Add Masks xy and xyn outlines like Ultralytics - #630
Conversation
…ch Python pixel for pixel Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
…y default like Ultralytics Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
…ltralytics Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
…tics scale_coords Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
|
👋 Hello @onuralpszr, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Reviewed the mask outline APIs, mask resizing and filtering paths, retina-masks configuration, annotation, and documentation. No actionable issues found; LGTM.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
Signed-off-by: Onuralp SEZER <onuralp@ultralytics.com>
|
🎉 This PR has been merged—thank you, @onuralpszr!
|
Adds
Masks::xy()andMasks::xyn()returning the outline of each mask, traced like OpenCVfindContoursand joined like Ultralyticsmasks2segments, then scaled to the image likescale_coords, with an example in both READMEs. Builds on #629. All 180 outlines from yolo26n-seg and yolo11n-seg match Python point for point.🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Adds
Masks::xy()andMasks::xyn()to return mask outlines in image-pixel and normalized coordinates, matching the Ultralytics-style outline workflow.📊 Key Changes
Masks::xy()traces mask pixels above0.5, keeps external contours, joins multiple contours at their closest points, and maps the points to the original image dimensions.Masks::xyn()normalizes thexy()points by the original image width and height; empty masks return outlines with no points.🎯 Purpose & Impact
Masksfor pixel-coordinate or normalized-coordinate workflows, while the existing mask data remains available.