Skip to content

Commit

Permalink
Fixing conversion of box formats on the original boxes (#2213)
Browse files Browse the repository at this point in the history
* chore: copy the original boxes and apply convert format

* chore: renaming variable
  • Loading branch information
ariG23498 authored Dec 27, 2023
1 parent e360fb7 commit 18b29be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions keras_cv/bounding_box/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,16 @@ 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,
images=images,
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(
Expand Down

0 comments on commit 18b29be

Please sign in to comment.