class_docstr: Head block for YOLOv3 network
  
  Args:
      norm_decay (float): weight decay for normalization layer weights
      num_classes (int): number of output classes
      ignore_thresh (float): threshold to ignore confidence loss
      label_smooth (bool): whether to use label smoothing
      anchors (list): anchors
      anchor_masks (list): anchor masks
      nms (object): an instance of `MultiClassNMS`
class_docstr_tok: ["Head","block","for","YOLOv3","network","Args",":","norm_decay","(","float",")",":","weight","decay","for","normalization","layer","weights","num_classes","(","int",")",":","number","of","output","classes","ignore_thresh","(","float",")",":","threshold","to","ignore","confidence","loss","label_smooth","(","bool",")",":","whether","to","use","label","smoothing","anchors","(","list",")",":","anchors","anchor_masks","(","list",")",":","anchor","masks","nms","(","object",")",":","an","instance","of","`","MultiClassNMS","`"]
docstr: Get prediction result of YOLOv3 network
  
  Args:
      outputs (list): list of Variables, return from _get_outputs
      im_size (Variable): Variable of size([h, w]) of each image
  
  Returns:
      pred (Variable): The prediction result after non-max suppress.
docstr_tok: ["Get","prediction","result","of","YOLOv3","network","Args",":","outputs","(","list",")",":","list","of","Variables",",","return","from","_get_outputs","im_size","(","Variable",")",":","Variable","of","size","(","[","h",",","w","]",")","of","each","image","Returns",":","pred","(","Variable",")",":","The","prediction","result","after","non-max","suppress","."]
code: def get_prediction(self, outputs, im_size):
      """
      Get prediction result of YOLOv3 network
  
      Args:
          outputs (list): list of Variables, return from _get_outputs
          im_size (Variable): Variable of size([h, w]) of each image
  
      Returns:
          pred (Variable): The prediction result after non-max suppress.
  
      """
      boxes = []
      scores = []
      downsample = 32
      for i, output in enumerate(outputs):
          box, score = fluid.layers.yolo_box(
              x=output,
              img_size=im_size,
              anchors=self.mask_anchors[i],
              class_num=self.num_classes,
              conf_thresh=self.nms.score_threshold,
              downsample_ratio=downsample,
              name=self.prefix_name + "yolo_box" + str(i),
          )
          boxes.append(box)
          scores.append(fluid.layers.transpose(score, perm=[0, 2, 1]))
  
          downsample //= 2
  
      yolo_boxes = fluid.layers.concat(boxes, axis=1)
      yolo_scores = fluid.layers.concat(scores, axis=2)
      pred = fluid.layers.multiclass_nms(
          bboxes=yolo_boxes,
          scores=yolo_scores,
          score_threshold=self.nms.score_threshold,
          nms_top_k=self.nms.nms_top_k,
          keep_top_k=self.nms.keep_top_k,
          nms_threshold=self.nms.nms_threshold,
          background_label=self.nms.background_label,
          normalized=self.nms.normalized,
          name="multiclass_nms",
      )
      return pred
  
file_path: PaddleHub/modules/image/object_detection/yolov3_darknet53_venus/yolo_head.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from collections import OrderedDict
  from paddle import fluid
  from paddle.fluid.param_attr import ParamAttr
  from paddle.fluid.regularizer import L2Decay
label_desc: Use image node_id 7 for calling the YOLOv3Head obj's underlying member method code with example usage: obj.get_prediction(outputs, im_size) and returns: pred