From aeb082c8c333d3a509d5097c1de856fbbced7f7a Mon Sep 17 00:00:00 2001 From: Shubham Chaudhari <47303345+shubhamchaudhari1996@users.noreply.github.com> Date: Wed, 11 May 2022 17:13:15 +0100 Subject: [PATCH] Bounding Box conversion Fixes Fixed bounding box conversions for traffic light and traffic sign. --- scripts/parsers/detection/detection_object.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)