Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions fastlabel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,14 @@ def __export_index_color_image(self, task: list, output_dir: str, pallete: List[
color = index if is_instance_segmentation else classes.index(annotation["value"]) + 1
if annotation["type"] == AnnotationType.segmentation.value:
for region in annotation["points"]:
count = 0
for points in region:
cv_draw_points = self.__get_cv_draw_points(points)
cv2.fillPoly(image, [cv_draw_points], color, lineType=cv2.LINE_8, shift=0)
# hollowd points are not supported
break
if count == 0:
cv2.fillPoly(image, [cv_draw_points], color, lineType=cv2.LINE_8, shift=0)
else:
cv2.fillPoly(image, [cv_draw_points], 0, lineType=cv2.LINE_8, shift=0)
count += 1
elif annotation["type"] == AnnotationType.polygon.value:
cv_draw_points = self.__get_cv_draw_points(annotation["points"])
cv2.fillPoly(image, [cv_draw_points], color, lineType=cv2.LINE_8, shift=0)
Expand Down
6 changes: 3 additions & 3 deletions fastlabel/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,16 @@ def to_pixel_coordinates(tasks: list) -> list:

# Remove duplicate points
for task in tasks:
for anno in task["annotations"]:
for annotation in task["annotations"]:
if annotation["type"] == AnnotationType.segmentation.value:
new_regions = []
for region in anno["points"]:
for region in annotation["points"]:
new_region = []
for points in region:
new_points = __remove_duplicated_coordinates(points)
new_region.append(new_points)
new_regions.append(new_region)
anno["points"] = new_regions
annotation["points"] = new_regions
elif annotation["type"] == AnnotationType.polygon.value:
new_points = __remove_duplicated_coordinates(annotation["points"])
annotation["points"] = new_points
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="fastlabel",
version="0.11.0",
version="0.11.1",
author="eisuke-ueta",
author_email="eisuke.ueta@fastlabel.ai",
description="The official Python SDK for FastLabel API, the Data Platform for AI",
Expand Down