Skip to content

Commit b8f1bb9

Browse files
Merge pull request #232 from fastlabel/fix-mask-export
fix export mask logic
2 parents 6222e1f + e01eff9 commit b8f1bb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fastlabel/converters.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,11 @@ def to_pixel_coordinates(tasks: list) -> list:
812812
for points in region:
813813
new_points = get_pixel_coordinates(points)
814814
new_region.append(new_points)
815+
if not (
816+
new_points[0] == new_points[-2]
817+
and new_points[1] == new_points[-1]
818+
):
819+
new_points.extend([new_points[0], new_points[1]])
815820
new_regions.append(new_region)
816821
annotation["points"] = new_regions
817822
elif annotation["type"] == AnnotationType.polygon.value:

0 commit comments

Comments
 (0)