diff --git a/scripts/parsers/detection/detection_object.py b/scripts/parsers/detection/detection_object.py index cfe7393..3c8bb6d 100644 --- a/scripts/parsers/detection/detection_object.py +++ b/scripts/parsers/detection/detection_object.py @@ -230,7 +230,9 @@ def merge(self, object_to_merge, class_name=None): # Merge polygons frist_polygon = self.get_polygon() second_polygon = object_to_merge.get_polygon() - union_polygon = cascaded_union([frist_polygon, second_polygon]) + frist_polygon_buf = frist_polygon.buffer(0) + second_polygon_buf = second_polygon.buffer(0) + union_polygon = cascaded_union([frist_polygon_buf, second_polygon_buf]) self.set_class_name(self.__class_name) self.set_metadata(self.__metadata)