code: def _max_distance_for_overlap(height, width, min_iou=0.7):
      """Computes how far apart bbox corners can lie while maintaining the iou.
  
      Given a bounding box size, this function returns a lower bound on how far
      apart the corners of another box can lie while still maintaining the given
      IoU. The implementation is based on the `gaussian_radius` function in the
      Objects as Points github repo: https://github.com/xingyizhou/CenterNet
  
      Args:
        height: A 1-D float Tensor representing height of the ground truth boxes.
        width: A 1-D float Tensor representing width of the ground truth boxes.
        min_iou: A float representing the minimum IoU desired.
  
      Returns:
       distance: A 1-D Tensor of distances, of the same length as the input
         height and width tensors.
      """
      height, width = tf.math.ceil(height), tf.math.ceil(width)
  
      distance_detection_offset = _smallest_positive_root(
          a=1,
          b=-(height + width),
          c=width * height * ((1 - min_iou) / (1 + min_iou)),
      )
  
      distance_detection_in_gt = _smallest_positive_root(
          a=4, b=-2 * (height + width), c=(1 - min_iou) * width * height
      )
  
      distance_gt_in_detection = _smallest_positive_root(
          a=4 * min_iou,
          b=(2 * min_iou) * (width + height),
          c=(min_iou - 1) * width * height,
      )
  
      return tf.reduce_min(
          [
              distance_detection_offset,
              distance_gt_in_detection,
              distance_detection_in_gt,
          ],
          axis=0,
      )
  
file_path: graphics/tensorflow_graphics/projects/points_to_3Dobjects/transforms/targets.py
imports: import tensorflow
  from google3.third_party.tensorflow_models.object_detection.core import box_list
  from google3.third_party.tensorflow_models.object_detection.core import box_list_ops
label_desc: Use image node_id 2 for calling a global function with example usage: _max_distance_for_overlap(height, width, min_iou) and returns: tf