text: # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
  # Copyright 2020 Huawei Technologies Co., Ltd
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #     http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  from __future__ import absolute_import, division, print_function, unicode_literals
  
  from detectron2 import _C
  
  
  def pairwise_iou_rotated(boxes1, boxes2):
      """
      Return intersection-over-union (Jaccard index) of boxes.
  
      Both sets of boxes are expected to be in
      (x_center, y_center, width, height, angle) format.
  
      Arguments:
          boxes1 (Tensor[N, 5])
          boxes2 (Tensor[M, 5])
  
      Returns:
          iou (Tensor[N, M]): the NxM matrix containing the pairwise
              IoU values for every element in boxes1 and boxes2
      """
      return _C.box_iou_rotated(boxes1, boxes2)
  