class_docstr: YOLOV3 target generator that requires network predictions.
  `Dynamic` indicate that the targets generated depend on current network.
  `Simple` indicate that it only support `pos_iou_thresh` >= 1.0,
  otherwise it's a lot more complicated and slower.
  (box regression targets and class targets are not necessary when `pos_iou_thresh` >= 1.0)
  
  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","generator","that","requires","network","predictions",".","`","Dynamic","`","indicate","that","the","targets","generated","depend","on","current","network",".","`","Simple","`","indicate","that","it","only","support","`","pos_iou_thresh","`",">","=","1.0",",","otherwise","it","'s","a","lot","more","complicated","and","slower",".","(","box","regression","targets","and","class","targets","are","not","necessary","when","`","pos_iou_thresh","`",">","=","1.0",")","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.
  
  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",".","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):
      """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.
  
      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():
          box_preds = box_preds.reshape((0, -1, 4))
          objness_t = F.zeros_like(
              box_preds.slice_axis(axis=-1, begin=0, end=1)
          )
          center_t = F.zeros_like(
              box_preds.slice_axis(axis=-1, begin=0, end=2)
          )
          scale_t = F.zeros_like(
              box_preds.slice_axis(axis=-1, begin=0, end=2)
          )
          weight_t = F.zeros_like(
              box_preds.slice_axis(axis=-1, begin=0, end=2)
          )
          class_t = (
              F.ones_like(objness_t.tile(reps=(self._num_class))) * -1
          )
          batch_ious = self._batch_iou(box_preds, gt_boxes)  # (B, N, M)
          ious_max = batch_ious.max(axis=-1, keepdims=True)  # (B, N, 1)
          objness_t = (
              ious_max > self._ignore_iou_thresh
          ) * -1  # use -1 for ignored
      return objness_t, center_t, scale_t, weight_t, class_t
  
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 YOLOV3DynamicTargetGeneratorSimple obj's underlying member method code with example usage: obj.hybrid_forward(F, box_preds, gt_boxes) and returns: objness_t,  center_t,  scale_t,  weight_t,  class_t