Skip to content

draw_bounding_boxes should check that (W, H) >= (xmax, ymax) >= (xmin, ymin) >= (0, 0) #5517

@norabelrose

Description

@norabelrose

🚀 The feature

Currently, draw_bounding_boxes does not sanity check the input bounding boxes to ensure that (xmax, ymax) >= (xmin, ymin). This can lead to unexpected output that can be difficult to debug if the user, say, inputs boxes in cxcywh format.

I could make a PR for this if needed but would prefer if someone else did it since I have my hands full with a PR I'm working on for PyTorch proper.

Motivation, pitch

I personally just ran into this problem and I thought something was wrong with my network for a while.

Currently, the box conversion ops do this check, and it seems at least as important to do the same check in draw_bounding_boxes.

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions