Skip to content

Potential bug on drawing segmentation mask with holes  #1771

Description

@XiaoSongXS

Instructions To Reproduce the 🐛 Bug:

  1. model has predicted segmentation masks with holes. (white area are predicted mask)

mask

  1. When Visualizer.draw_instance_predictions() create GenericMask and call Visualizer.overlay_instances

  2. Visualizer.overlay_instances draws mask with "polygon" formate, which considers the holes inside the prediction (which have it own polygon) as part of the prediction.

Screen Shot 2020-07-14 at 7 04 55 PM

  1. This would induce result like this, where the holes are also considered as predicted area.

prediciton

  1. This is mainly because when the class::GenericMask return the polygon, it does not consider the hole information

Screen Shot 2020-07-14 at 7 09 46 PM

and this have to do with cv2.findContours(mask.astype("uint8"), cv2.RETR_CCOMP, cv2.CHAIN_APPROX_NONE) return holes inside the mask but there's not subsequrnce operation to filter out those polygon
Screen Shot 2020-07-14 at 8 29 30 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlycontributions welcomewelcome contributors

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions