code: def compute_ctrness_targets(reg_targets):
      if len(reg_targets) == 0:
          return reg_targets.new_zeros(len(reg_targets))
      left_right = reg_targets[:, [0, 2]]
      top_bottom = reg_targets[:, [1, 3]]
      ctrness = (
          left_right.min(dim=-1)[0] / left_right.max(dim=-1)[0]
      ) * (top_bottom.min(dim=-1)[0] / top_bottom.max(dim=-1)[0])
      return torch.sqrt(ctrness)
  
imports: import logging
  import os
  from typing import List
  import numpy
  import torch
  from torch import nn
  import torch.nn.functional
  from torchvision.ops import nms
  from ...data.structures import Instances, Boxes
  from ...utils.comm import get_world_size
  from ...nn.focal_loss import sigmoid_focal_loss_jit
  from ...nn.smooth_l1_loss import smooth_l1_loss
  from ...utils.comm import reduce_sum
  from ...nn.nms import ml_nms, oks_nms, close_kpt_nms
  from ...nn.iou_loss import IOULoss
  from ...nn.keypoint_loss import WeightedMSELoss, HMFocalLoss
label_desc: Use image node_id 2 for calling a global function with example usage: compute_ctrness_targets(reg_targets) and returns: torch, reg_targets