Skip to content

Commit 1ad8ec3

Browse files
authored
Merge pull request #67 from fastlabel/develop
Merge to main
2 parents 361014f + 6f33c15 commit 1ad8ec3

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

fastlabel/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,11 +756,14 @@ def __export_index_color_image(self, task: list, output_dir: str, pallete: List[
756756
color = index if is_instance_segmentation else classes.index(annotation["value"]) + 1
757757
if annotation["type"] == AnnotationType.segmentation.value:
758758
for region in annotation["points"]:
759+
count = 0
759760
for points in region:
760761
cv_draw_points = self.__get_cv_draw_points(points)
761-
cv2.fillPoly(image, [cv_draw_points], color, lineType=cv2.LINE_8, shift=0)
762-
# hollowd points are not supported
763-
break
762+
if count == 0:
763+
cv2.fillPoly(image, [cv_draw_points], color, lineType=cv2.LINE_8, shift=0)
764+
else:
765+
cv2.fillPoly(image, [cv_draw_points], 0, lineType=cv2.LINE_8, shift=0)
766+
count += 1
764767
elif annotation["type"] == AnnotationType.polygon.value:
765768
cv_draw_points = self.__get_cv_draw_points(annotation["points"])
766769
cv2.fillPoly(image, [cv_draw_points], color, lineType=cv2.LINE_8, shift=0)

fastlabel/converters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,16 @@ def to_pixel_coordinates(tasks: list) -> list:
304304

305305
# Remove duplicate points
306306
for task in tasks:
307-
for anno in task["annotations"]:
307+
for annotation in task["annotations"]:
308308
if annotation["type"] == AnnotationType.segmentation.value:
309309
new_regions = []
310-
for region in anno["points"]:
310+
for region in annotation["points"]:
311311
new_region = []
312312
for points in region:
313313
new_points = __remove_duplicated_coordinates(points)
314314
new_region.append(new_points)
315315
new_regions.append(new_region)
316-
anno["points"] = new_regions
316+
annotation["points"] = new_regions
317317
elif annotation["type"] == AnnotationType.polygon.value:
318318
new_points = __remove_duplicated_coordinates(annotation["points"])
319319
annotation["points"] = new_points

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setuptools.setup(
1010
name="fastlabel",
11-
version="0.11.0",
11+
version="0.11.1",
1212
author="eisuke-ueta",
1313
author_email="[email protected]",
1414
description="The official Python SDK for FastLabel API, the Data Platform for AI",

0 commit comments

Comments
 (0)