class_docstr: Calculate detection mean average precision.
  Currently support two types: 11point and integral
  
  Args:
      class_num (int): The class number.
      overlap_thresh (float): The threshold of overlap
          ratio between prediction bounding box and 
          ground truth bounding box for deciding 
          true/false positive. Default 0.5.
      map_type (str): Calculation method of mean average
          precision, currently support '11point' and
          'integral'. Default '11point'.
      is_bbox_normalized (bool): Whether bounding boxes
          is normalized to range[0, 1]. Default False.
      evaluate_difficult (bool): Whether to evaluate
          difficult bounding boxes. Default False.
      catid2name (dict): Mapping between category id and category name.
      classwise (bool): Whether per-category AP and draw
          P-R Curve or not.
class_docstr_tok: ["Calculate","detection","mean","average","precision",".","Currently","support","two","types",":","11point","and","integral","Args",":","class_num","(","int",")",":","The","class","number",".","overlap_thresh","(","float",")",":","The","threshold","of","overlap","ratio","between","prediction","bounding","box","and","ground","truth","bounding","box","for","deciding","true\/false","positive",".","Default","0.5.","map_type","(","str",")",":","Calculation","method","of","mean","average","precision",",","currently","support","'11point","'","and","'integral","'",".","Default","'11point","'",".","is_bbox_normalized","(","bool",")",":","Whether","bounding","boxes","is","normalized","to","range","[","0",",","1","]",".","Default","False",".","evaluate_difficult","(","bool",")",":","Whether","to","evaluate","difficult","bounding","boxes",".","Default","False",".","catid2name","(","dict",")",":","Mapping","between","category","id","and","category","name",".","classwise","(","bool",")",":","Whether","per-category","AP","and","draw","P-R","Curve","or","not","."]
docstr: Update metric statics from given prediction and ground
  truth infomations.
docstr_tok: ["Update","metric","statics","from","given","prediction","and","ground","truth","infomations","."]
code: def update(
      self, bbox, score, label, gt_box, gt_label, difficult=None
  ):
      """
      Update metric statics from given prediction and ground
      truth infomations.
      """
      if difficult is None:
          difficult = np.zeros_like(gt_label)
  
      # record class gt count
      for gtl, diff in zip(gt_label, difficult):
          if self.evaluate_difficult or int(diff) == 0:
              self.class_gt_counts[int(np.array(gtl))] += 1
  
      # record class score positive
      visited = [False] * len(gt_label)
      for b, s, l in zip(bbox, score, label):
          pred = b.tolist() if isinstance(b, np.ndarray) else b
          max_idx = -1
          max_overlap = -1.0
          for i, gl in enumerate(gt_label):
              if int(gl) == int(l):
                  if len(gt_box[i]) == 8:
                      overlap = calc_rbox_iou(pred, gt_box[i])
                  else:
                      overlap = jaccard_overlap(
                          pred, gt_box[i], self.is_bbox_normalized
                      )
                  if overlap > max_overlap:
                      max_overlap = overlap
                      max_idx = i
  
          if max_overlap > self.overlap_thresh:
              if (
                  self.evaluate_difficult
                  or int(np.array(difficult[max_idx])) == 0
              ):
                  if not visited[max_idx]:
                      self.class_score_poss[int(l)].append([s, 1.0])
                      visited[max_idx] = True
                  else:
                      self.class_score_poss[int(l)].append([s, 0.0])
          else:
              self.class_score_poss[int(l)].append([s, 0.0])
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import sys
  import numpy
  import itertools
  import paddle
  from ppdet.modeling.rbox_utils import poly2rbox_np
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling the DetectionMAP obj's underlying member method code with example usage: obj.update(bbox, score, label, gt_box, gt_label, difficult) without return types