Skip to content

implement box_iou_rotated #31

Description

@cregouby

Current Situation

there is no way to operate rotated bbox IoU at scale.

Expected Situation

Implement and export the torch/vision ops : https://github.com/pytorch/vision/tree/main/torchvision/csrc/ops :

  • Implemented Rotated box iou calculation backend using C++ on CPU.
  • Implemented rotated_box_iou function to compute Intersection over Union (IoU) between rotated bounding boxes.
  • The public API follows the existing box_iou pattern and supports all three rotated box formats: cxcywhr, xywhr, and xyxyxyxy.

Proposed Test Plan: see (pytorch/vision#9379)
Added TestRotatedBoxIou test class with comprehensive tests:

Core IoU test with 4 boxes (including 45° rotated box) across all three formats

Rotation behavior tests (90°, 180°, 45°, negative angles)

Edge case tests (containment, zero area)

API contract tests (output shape, invalid format, format consistency)

Metadata

Metadata

Assignees

No one assigned

    Labels

    GSoCIntended to be covered by the GSoC teamenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions