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","."]
code: def __init__(
      self,
      class_num,
      overlap_thresh=0.5,
      map_type="11point",
      is_bbox_normalized=False,
      evaluate_difficult=False,
      catid2name=None,
      classwise=False,
  ):
      self.class_num = class_num
      self.overlap_thresh = overlap_thresh
      assert map_type in ["11point", "integral"], (
          "map_type currently only support '11point' " "and 'integral'"
      )
      self.map_type = map_type
      self.is_bbox_normalized = is_bbox_normalized
      self.evaluate_difficult = evaluate_difficult
      self.classwise = classwise
      self.classes = []
      for cname in catid2name.values():
          self.classes.append(cname)
      self.reset()
  
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 1 to create a new DetectionMAP object from inherited base classes: object with example: obj = DetectionMAP(class_num, overlap_thresh, map_type, is_bbox_normalized, evaluate_difficult, catid2name, classwise)