Skip to content

Redundant return in convert_format #2201

@ariG23498

Description

@ariG23498

In the following lines I have noticed that the bounding boxes are converted in place. I am not sure why we return the dictionary again. This does not raise a bug, but breaks the mental model of inplace and out of place changes.

if isinstance(boxes, dict):
boxes["boxes"] = convert_format(
boxes["boxes"],
source=source,
target=target,
images=images,
image_shape=image_shape,
dtype=dtype,
)
return boxes

It would rather be useful to create a new dictionary and return the converted bbox where the original is kept as is.

If that is a good change, I would like to contribute to this (will be a quick fix)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions