Currently, we have similar box conversion functionality implemented in two places:
This duplication is not ideal and could lead to inconsistencies (e.g., different rounding behavior for integer tensors).
Suggested investigation:
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)
Currently, we have similar box conversion functionality implemented in two places:
torchvision/ops/_box_convert.pytorchvision/transforms/v2/functional/_meta.pyThis 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)