Skip to content

Investigate merging box conversion utils from ops and transforms #9387

Description

@zy1git

Currently, we have similar box conversion functionality implemented in two places:

  • torchvision/ops/_box_convert.py

  • torchvision/transforms/v2/functional/_meta.py

This duplication is not ideal and could lead to inconsistencies (e.g., different rounding behavior for integer tensors).

Suggested investigation:

  • Compare the two implementations for correctness and consistency

  • Run benchmarks to evaluate which implementation is more efficient

  • Merge them into one.

Considerations:

The transforms version supports inplace operations, while the ops version does not.
Any changes should maintain backward compatibility

Related: PR #9322 (Fix CXCYWH to XYXY conversion for integer bounding boxes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions