code: def map_rois_to_fpn_levels(rois, k_min, k_max):
      """Determine which FPN level each RoI in a set of RoIs should map to based
      on the heuristic in the FPN paper.
      """
      # Compute level ids
      s = np.sqrt(box_utils.boxes_area(rois))
      s0 = cfg.FPN.ROI_CANONICAL_SCALE  # default: 224
      lvl0 = cfg.FPN.ROI_CANONICAL_LEVEL  # default: 4
  
      # Eqn.(1) in FPN paper
      target_lvls = np.floor(lvl0 + np.log2(s / s0 + 1e-6))
      target_lvls = np.clip(target_lvls, k_min, k_max)
      return target_lvls
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import collections
  import numpy
  from detectron.core.config import cfg
  from detectron.modeling.generate_anchors import generate_anchors
  from detectron.utils.c2 import const_fill
  from detectron.utils.c2 import gauss_fill
  from detectron.utils.net import get_group_gn
  import detectron.modeling.ResNet
  import detectron.utils.blob
  import detectron.utils.boxes
label_desc: Use image node_id 13 for calling a global function with example usage: map_rois_to_fpn_levels(rois, k_min, k_max) and returns: target_lvls