code: def non_maximum_suppression(bbox, thresh, score=None, limit=None):
      """Suppress bounding boxes according to their IoUs.
  
      This method checks each bounding box sequentially and selects the bounding
      box if the Intersection over Unions (IoUs) between the bounding box and the
      previously selected bounding boxes is less than :obj:`thresh`. This method
      is mainly used as postprocessing of object detection.
      The bounding boxes are selected from ones with higher scores.
      If :obj:`score` is not provided as an argument, the bounding box
      is ordered by its index in ascending order.
  
      The bounding boxes are expected to be packed into a two dimensional
      tensor of shape :math:`(R, 4)`, where :math:`R` is the number of
      bounding boxes in the image. The second axis represents attributes of
      the bounding box. They are :math:`(y_{min}, x_{min}, y_{max}, x_{max})`,
      where the four attributes are coordinates of the top left and the
      bottom right vertices.
  
      :obj:`score` is a float array of shape :math:`(R,)`. Each score indicates
      confidence of prediction.
  
      This function accepts both :obj:`numpy.ndarray` and :obj:`cupy.ndarray` as
      an input. Please note that both :obj:`bbox` and :obj:`score` need to be
      the same type.
      The type of the output is the same as the input.
  
      Args:
          bbox (array): Bounding boxes to be transformed. The shape is
              :math:`(R, 4)`. :math:`R` is the number of bounding boxes.
          thresh (float): Threshold of IoUs.
          score (array): An array of confidences whose shape is :math:`(R,)`.
          limit (int): The upper bound of the number of the output bounding
              boxes. If it is not specified, this method selects as many
              bounding boxes as possible.
  
      Returns:
          array:
          An array with indices of bounding boxes that are selected. \
          They are sorted by the scores of bounding boxes in descending \
          order. \
          The shape of this array is :math:`(K,)` and its dtype is\
          :obj:`numpy.int32`. Note that :math:`K \\leq R`.
  
      """
  
      xp = cuda.get_array_module(bbox)
      if xp == np:
          return _non_maximum_suppression_cpu(
              bbox, thresh, score, limit
          )
      else:
          return _non_maximum_suppression_gpu(
              bbox, thresh, score, limit
          )
  
file_path: chainercv/chainercv/utils/bbox/non_maximum_suppression.py
imports: from __future__ import division
  import numpy
  from chainer.backends import cuda
  from chainercv.utils.bbox._nms_gpu_post import _nms_gpu_post
label_desc: Use image node_id 1 for calling a global function with example usage: non_maximum_suppression(bbox, thresh, score, limit) and returns: _non_maximum_suppression_cpu, _non_maximum_suppression_gpu