class_docstr: Target generator for CenterNet.
  
  Parameters
  ----------
  num_class : int
      Number of categories.
  output_width : int
      Width of the network output.
  output_height : int
      Height of the network output.
class_docstr_tok: ["Target","generator","for","CenterNet",".","Parameters","--","--","--","--","--","num_class",":","int","Number","of","categories",".","output_width",":","int","Width","of","the","network","output",".","output_height",":","int","Height","of","the","network","output","."]
docstr: Target generation
docstr_tok: ["Target","generation"]
code: def forward(self, gt_boxes, gt_ids):
      """Target generation"""
      # pylint: disable=arguments-differ
      h_scale = 1.0  # already scaled in affinetransform
      w_scale = 1.0  # already scaled in affinetransform
      heatmap = np.zeros(
          (self._num_class, self._output_height, self._output_width),
          dtype=np.float32,
      )
      wh_target = np.zeros(
          (2, self._output_height, self._output_width), dtype=np.float32
      )
      wh_mask = np.zeros(
          (2, self._output_height, self._output_width), dtype=np.float32
      )
      center_reg = np.zeros(
          (2, self._output_height, self._output_width), dtype=np.float32
      )
      center_reg_mask = np.zeros(
          (2, self._output_height, self._output_width), dtype=np.float32
      )
      for bbox, cid in zip(gt_boxes, gt_ids):
          cid = int(cid)
          box_h, box_w = bbox[3] - bbox[1], bbox[2] - bbox[0]
          if box_h > 0 and box_w > 0:
              radius = _gaussian_radius(
                  (np.ceil(box_h), np.ceil(box_w))
              )
              radius = max(0, int(radius))
              center = np.array(
                  [
                      (bbox[0] + bbox[2]) / 2 * w_scale,
                      (bbox[1] + bbox[3]) / 2 * h_scale,
                  ],
                  dtype=np.float32,
              )
              center_int = center.astype(np.int32)
              center_x, center_y = center_int
              assert (
                  center_x < self._output_width
              ), "center_x: {} > output_width: {}".format(
                  center_x, self._output_width
              )
              assert (
                  center_y < self._output_height
              ), "center_y: {} > output_height: {}".format(
                  center_y, self._output_height
              )
              _draw_umich_gaussian(heatmap[cid], center_int, radius)
              wh_target[0, center_y, center_x] = box_w * w_scale
              wh_target[1, center_y, center_x] = box_h * h_scale
              wh_mask[:, center_y, center_x] = 1.0
              center_reg[:, center_y, center_x] = center - center_int
              center_reg_mask[:, center_y, center_x] = 1.0
      return tuple(
          [
              nd.array(x)
              for x in (
                  heatmap,
                  wh_target,
                  wh_mask,
                  center_reg,
                  center_reg_mask,
              )
          ]
      )
  
file_path: gluon-cv/gluoncv/model_zoo/center_net/target_generator.py
imports: from __future__ import absolute_import
  import numpy
  from mxnet import nd
  from mxnet import gluon
label_desc: Use image node_id 2 for calling the CenterNetTargetGenerator obj's underlying member method code with example usage: obj.forward(gt_boxes, gt_ids) and returns: tuple