From 18b29be243ae5e87f53fba2ef9a96f5ec7ad4136 Mon Sep 17 00:00:00 2001 From: Aritra Roy Gosthipaty Date: Wed, 27 Dec 2023 23:45:19 +0530 Subject: [PATCH] Fixing conversion of box formats on the original boxes (#2213) * chore: copy the original boxes and apply convert format * chore: renaming variable --- keras_cv/bounding_box/converters.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keras_cv/bounding_box/converters.py b/keras_cv/bounding_box/converters.py index 8923527cbf..b671b6ff22 100644 --- a/keras_cv/bounding_box/converters.py +++ b/keras_cv/bounding_box/converters.py @@ -370,7 +370,8 @@ def convert_format( `"float32"`. """ if isinstance(boxes, dict): - boxes["boxes"] = convert_format( + converted_boxes = boxes.copy() + converted_boxes["boxes"] = convert_format( boxes["boxes"], source=source, target=target, @@ -378,7 +379,7 @@ def convert_format( image_shape=image_shape, dtype=dtype, ) - return boxes + return converted_boxes if boxes.shape[-1] is not None and boxes.shape[-1] != 4: raise ValueError(