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.
Description
Improved the mask_to_polygons function to handle masks that have exclusions and Masks that do not align
Example:
Detections of Doughnut: Even if the Model correctly detects the Doughnut, the Polygon always was only the outer shape. With this change the hole in the middle is excluded from the Polygon
Person behind a table: When the Model identifies the Person correctly, the Part above and below the Table would have been two separate Polygons. With this change, it would be one Polygon connected.
List any dependencies that are required for this change.
Type of change
Please delete options that are not relevant.
-> Arguably brings the Polygon functions closer to expected behavior
How has this change been tested, please provide a testcase or example of how you tested the change?
Example:
Mask Annotator: (unchanged)
Polygon Conversion before PR:
Polygon Conversion after PR:
Any specific deployment considerations
Also changed the Polygon Annotator to display a filled Polygon
Docs
The original issue is not Documented. If the change to draw_polygon is accepted as well, the documentation for the function needs to be updated.