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: Check ANCHORS/ANCHOR_MASKS in config and parse mask_anchors
docstr_tok: ["Check","ANCHORS\/ANCHOR_MASKS","in","config","and","parse","mask_anchors"]
code: def _parse_anchors(self, anchors):
      """
      Check ANCHORS/ANCHOR_MASKS in config and parse mask_anchors
  
      """
      self.anchors = []
      self.mask_anchors = []
  
      assert len(anchors) > 0, "ANCHORS not set."
      assert len(self.anchor_masks) > 0, "ANCHOR_MASKS not set."
  
      for anchor in anchors:
          assert len(anchor) == 2, "anchor {} len should be 2".format(
              anchor
          )
          self.anchors.extend(anchor)
  
      anchor_num = len(anchors)
      for masks in self.anchor_masks:
          self.mask_anchors.append([])
          for mask in masks:
              assert mask < anchor_num, "anchor mask index overflow"
              self.mask_anchors[-1].extend(anchors[mask])
  
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 5 for calling the YOLOv3Head obj's underlying member method code with example usage: obj._parse_anchors(anchors) without return types