Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions fastlabel/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,11 @@ def to_pixel_coordinates(tasks: list) -> list:
for points in region:
new_points = __get_pixel_coordinates(points)
new_region.append(new_points)
if not (
new_points[0] == new_points[-2]
and new_points[1] == new_points[-1]
):
new_points.extend([new_points[0], new_points[1]])
Comment on lines +815 to +819
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[432, 436, 431, 437, 415, 437, 414, 438, 398, 438, 397, 439, 384, 439, 383, 440, 372,]のような形で始点と終点が異なる場合に正しくないマスク画像が出力されてしまうので修正

new_regions.append(new_region)
annotation["points"] = new_regions
elif annotation["type"] == AnnotationType.polygon.value:
Expand Down