code: def _get_region_detections(
      l, im_shape, net_shape, thresh, relative, dets
  ):
      data = l["output"]
      before_correct_dets = []
      for row in range(data.shape[2]):
          for col in range(data.shape[3]):
              for n in range(data.shape[0]):
                  prob = [0] * l["classes"]
                  scale = (
                      data[n, l["coords"], row, col]
                      if not l["background"]
                      else 1
                  )
                  location = [n, row, col]
                  box_b = _get_box(
                      data,
                      l["biases"],
                      n,
                      location,
                      data.shape[3],
                      data.shape[2],
                      data.shape[3],
                      data.shape[2],
                  )
                  objectness = scale if scale > thresh else 0
                  if objectness:
                      prob = (
                          scale
                          * data[
                              n,
                              l["coords"]
                              + 1 : l["coords"]
                              + 1
                              + l["classes"],
                              row,
                              col,
                          ]
                      )
                      prob[prob < thresh] = 0
                  detection = {}
                  detection["bbox"] = box_b
                  detection["prob"] = prob
                  detection["objectness"] = objectness
                  before_correct_dets.append(detection)
      _correct_boxes(
          before_correct_dets,
          im_shape[0],
          im_shape[1],
          net_shape[0],
          net_shape[1],
          relative,
      )
      dets.extend(before_correct_dets)
  
imports: from __future__ import division
  import math
  from collections import namedtuple
  from functools import cmp_to_key
  import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: _get_region_detections(l, im_shape, net_shape, thresh, relative, dets) without return types