Skip to content

Conversation

@msokoloff1
Copy link
Contributor

There is a small chance that our algorithm for creating polygons from rasters creates small self intersections. Ultimately these polygons become invalid and errors are thrown when we attempt to use the invalid polygons.

categories[annotation.name] = hash_category_name(annotation.name)
if isinstance(annotation.value, Mask):
segment, canvas = (mask_to_coco_segment_info(
coco_segment_info = mask_to_coco_segment_info(
Copy link
Contributor

Choose a reason for hiding this comment

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

Questions around this.

  1. How can coco_segment_info be set to segment, canvas when it's only returning SegmentInfo object?
  2. When can coco_segment_info be None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. mask_to_coco_segment_info returns both of those things. It is hard to read because canvas looks like it is part of the SegmentInfo object but it isn't
  2. coco_segment_info can be None if the annotation is invalid. Like an empty seg mask is exported for whatever reason.

@msokoloff1 msokoloff1 merged commit 70ee77d into develop Oct 24, 2022
@msokoloff1 msokoloff1 deleted the ms/coco-invalid-polygons branch October 24, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants