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: Get mAP result
docstr_tok: ["Get","mAP","result"]
code: def get_map(self):
      """
      Get mAP result
      """
      if self.mAP is None:
          logger.error("mAP is not calculated.")
      if self.classwise:
          # Compute per-category AP and PR curve
          try:
              from terminaltables import AsciiTable
          except Exception as e:
              logger.error(
                  "terminaltables not found, plaese install terminaltables. "
                  "for example: `pip install terminaltables`."
              )
              raise e
          results_per_category = []
          for eval_result in self.eval_results:
              results_per_category.append(
                  (
                      str(eval_result["class"]),
                      "{:0.3f}".format(float(eval_result["ap"])),
                  )
              )
              draw_pr_curve(
                  eval_result["precision"],
                  eval_result["recall"],
                  out_dir="voc_pr_curve",
                  file_name="{}_precision_recall_curve.jpg".format(
                      eval_result["class"]
                  ),
              )
  
          num_columns = min(6, len(results_per_category) * 2)
          results_flatten = list(itertools.chain(*results_per_category))
          headers = ["category", "AP"] * (num_columns // 2)
          results_2d = itertools.zip_longest(
              *[
                  results_flatten[i::num_columns]
                  for i in range(num_columns)
              ]
          )
          table_data = [headers]
          table_data += [result for result in results_2d]
          table = AsciiTable(table_data)
          logger.info(
              "Per-category of VOC AP: \n{}".format(table.table)
          )
          logger.info(
              "per-category PR curve has output to voc_pr_curve folder."
          )
      return self.mAP
  
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 5 for calling the DetectionMAP obj's underlying member method code with example usage: obj.get_map() and returns: self