class_docstr: YOLOV3 target merger that merges the prefetched targets and dynamic targets.
  
  Parameters
  ----------
  num_class : int
      Number of foreground classes.
  ignore_iou_thresh : float
      Anchors that has IOU in `range(ignore_iou_thresh, pos_iou_thresh)` don't get
      penalized of objectness score.
class_docstr_tok: ["YOLOV3","target","merger","that","merges","the","prefetched","targets","and","dynamic","targets",".","Parameters","--","--","--","--","--","num_class",":","int","Number","of","foreground","classes",".","ignore_iou_thresh",":","float","Anchors","that","has","IOU","in","`","range","(","ignore_iou_thresh",",","pos_iou_thresh",")","`","do","n't","get","penalized","of","objectness","score","."]
docstr: Short summary.
  
  Parameters
  ----------
  F : mxnet.nd or mxnet.sym
      `F` is mxnet.sym if hybridized or mxnet.nd if not.
  box_preds : mxnet.nd.NDArray
      Predicted bounding boxes.
  gt_boxes : mxnet.nd.NDArray
      Ground-truth bounding boxes.
  obj_t : mxnet.nd.NDArray
      Prefetched Objectness targets.
  centers_t : mxnet.nd.NDArray
      Prefetched regression target for center x and y.
  scales_t : mxnet.nd.NDArray
      Prefetched regression target for scale x and y.
  weights_t : mxnet.nd.NDArray
      Prefetched element-wise gradient weights for center_targets and scale_targets.
  clas_t : mxnet.nd.NDArray
      Prefetched one-hot vector for classification.
  
  Returns
  -------
  (tuple of) mxnet.nd.NDArray
      objectness: 0 for negative, 1 for positive, -1 for ignore.
      center_targets: regression target for center x and y.
      scale_targets: regression target for scale x and y.
      weights: element-wise gradient weights for center_targets and scale_targets.
      class_targets: a one-hot vector for classification.
docstr_tok: ["Short","summary",".","Parameters","--","--","--","--","--","F",":","mxnet.nd","or","mxnet.sym","`","F","`","is","mxnet.sym","if","hybridized","or","mxnet.nd","if","not",".","box_preds",":","mxnet.nd.NDArray","Predicted","bounding","boxes",".","gt_boxes",":","mxnet.nd.NDArray","Ground-truth","bounding","boxes",".","obj_t",":","mxnet.nd.NDArray","Prefetched","Objectness","targets",".","centers_t",":","mxnet.nd.NDArray","Prefetched","regression","target","for","center","x","and","y.","scales_t",":","mxnet.nd.NDArray","Prefetched","regression","target","for","scale","x","and","y.","weights_t",":","mxnet.nd.NDArray","Prefetched","element-wise","gradient","weights","for","center_targets","and","scale_targets",".","clas_t",":","mxnet.nd.NDArray","Prefetched","one-hot","vector","for","classification",".","Returns","--","--","--","-","(","tuple","of",")","mxnet.nd.NDArray","objectness",":","0","for","negative",",","1","for","positive",",","-1","for","ignore",".","center_targets",":","regression","target","for","center","x","and","y.","scale_targets",":","regression","target","for","scale","x","and","y.","weights",":","element-wise","gradient","weights","for","center_targets","and","scale_targets",".","class_targets",":","a","one-hot","vector","for","classification","."]
code: def hybrid_forward(
      self,
      F,
      box_preds,
      gt_boxes,
      obj_t,
      centers_t,
      scales_t,
      weights_t,
      clas_t,
  ):
      """Short summary.
  
      Parameters
      ----------
      F : mxnet.nd or mxnet.sym
          `F` is mxnet.sym if hybridized or mxnet.nd if not.
      box_preds : mxnet.nd.NDArray
          Predicted bounding boxes.
      gt_boxes : mxnet.nd.NDArray
          Ground-truth bounding boxes.
      obj_t : mxnet.nd.NDArray
          Prefetched Objectness targets.
      centers_t : mxnet.nd.NDArray
          Prefetched regression target for center x and y.
      scales_t : mxnet.nd.NDArray
          Prefetched regression target for scale x and y.
      weights_t : mxnet.nd.NDArray
          Prefetched element-wise gradient weights for center_targets and scale_targets.
      clas_t : mxnet.nd.NDArray
          Prefetched one-hot vector for classification.
  
      Returns
      -------
      (tuple of) mxnet.nd.NDArray
          objectness: 0 for negative, 1 for positive, -1 for ignore.
          center_targets: regression target for center x and y.
          scale_targets: regression target for scale x and y.
          weights: element-wise gradient weights for center_targets and scale_targets.
          class_targets: a one-hot vector for classification.
  
      """
      with autograd.pause():
          dynamic_t = self._dynamic_target(box_preds, gt_boxes)
          # use fixed target to override dynamic targets
          obj, centers, scales, weights, clas = zip(
              dynamic_t, [obj_t, centers_t, scales_t, weights_t, clas_t]
          )
          mask = obj[1] > 0
          objectness = F.where(mask, obj[1], obj[0])
          mask2 = mask.tile(reps=(2,))
          center_targets = F.where(mask2, centers[1], centers[0])
          scale_targets = F.where(mask2, scales[1], scales[0])
          weights = F.where(mask2, weights[1], weights[0])
          mask3 = mask.tile(reps=(self._num_class,))
          class_targets = F.where(mask3, clas[1], clas[0])
          smooth_weight = 1.0 / self._num_class
          if self._label_smooth:
              smooth_weight = min(1.0 / self._num_class, 1.0 / 40)
              class_targets = F.where(
                  class_targets > 0.5,
                  class_targets - smooth_weight,
                  class_targets,
              )
              class_targets = F.where(
                  (class_targets < -0.5) + (class_targets > 0.5),
                  class_targets,
                  F.ones_like(class_targets) * smooth_weight,
              )
          class_mask = mask.tile(reps=(self._num_class,)) * (
              class_targets >= 0
          )
          return [
              F.stop_gradient(x)
              for x in [
                  objectness,
                  center_targets,
                  scale_targets,
                  weights,
                  class_targets,
                  class_mask,
              ]
          ]
  
file_path: gluon-cv/gluoncv/model_zoo/yolo/yolo_target.py
imports: from __future__ import absolute_import
  from __future__ import division
  import numpy
  from mxnet import gluon
  from mxnet import nd
  from mxnet import autograd
  from ...nn.bbox import BBoxCornerToCenter, BBoxCenterToCorner, BBoxBatchIOU
label_desc: Use image node_id 2 for calling the YOLOV3TargetMerger obj's underlying member method code with example usage: obj.hybrid_forward(F, box_preds, gt_boxes, obj_t, centers_t, scales_t, weights_t, clas_t) and returns: unknown