docstr: Evaluation in Cityscapes/COCO protocol.
  
  Args:
      results (list[list | tuple]): Testing results of the dataset.
      metric (str | list[str]): Metrics to be evaluated. Options are
          'bbox', 'segm', 'proposal', 'proposal_fast'.
      logger (logging.Logger | str | None): Logger used for printing
          related information during evaluation. Default: None.
      outfile_prefix (str | None): The prefix of output file. It includes
          the file path and the prefix of filename, e.g., "a/b/prefix".
          If results are evaluated with COCO protocol, it would be the
          prefix of output json file. For example, the metric is 'bbox'
          and 'segm', then json files would be "a/b/prefix.bbox.json" and
          "a/b/prefix.segm.json".
          If results are evaluated with cityscapes protocol, it would be
          the prefix of output txt/png files. The output files would be
          png images under folder "a/b/prefix/xxx/" and the file name of
          images would be written into a txt file
          "a/b/prefix/xxx_pred.txt", where "xxx" is the video name of
          cityscapes. If not specified, a temp file will be created.
          Default: None.
      classwise (bool): Whether to evaluating the AP for each class.
      proposal_nums (Sequence[int]): Proposal number used for evaluating
          recalls, such as recall@100, recall@1000.
          Default: (100, 300, 1000).
      iou_thrs (Sequence[float]): IoU threshold used for evaluating
          recalls. If set to a list, the average recall of all IoUs will
          also be computed. Default: 0.5.
  
  Returns:
      dict[str, float]: COCO style evaluation metric or cityscapes mAP                 and AP@50.
docstr_tok: ["Evaluation","in","Cityscapes\/COCO","protocol",".","Args",":","results","(","list","[","list","|","tuple","]",")",":","Testing","results","of","the","dataset",".","metric","(","str","|","list","[","str","]",")",":","Metrics","to","be","evaluated",".","Options","are","'bbox","'",",","'segm","'",",","'proposal","'",",","'proposal_fast","'",".","logger","(","logging.Logger","|","str","|","None",")",":","Logger","used","for","printing","related","information","during","evaluation",".","Default",":","None",".","outfile_prefix","(","str","|","None",")",":","The","prefix","of","output","file",".","It","includes","the","file","path","and","the","prefix","of","filename",",","e.g.",",","``","a\/b\/prefix","''",".","If","results","are","evaluated","with","COCO","protocol",",","it","would","be","the","prefix","of","output","json","file",".","For","example",",","the","metric","is","'bbox'","and","'segm","'",",","then","json","files","would","be","``","a\/b\/prefix.bbox.json","''","and","``","a\/b\/prefix.segm.json","''",".","If","results","are","evaluated","with","cityscapes","protocol",",","it","would","be","the","prefix","of","output","txt\/png","files",".","The","output","files","would","be","png","images","under","folder","``","a\/b\/prefix\/xxx\/","''","and","the","file","name","of","images","would","be","written","into","a","txt","file","``","a\/b\/prefix\/xxx_pred.txt","''",",","where","``","xxx","''","is","the","video","name","of","cityscapes",".","If","not","specified",",","a","temp","file","will","be","created",".","Default",":","None",".","classwise","(","bool",")",":","Whether","to","evaluating","the","AP","for","each","class",".","proposal_nums","(","Sequence","[","int","]",")",":","Proposal","number","used","for","evaluating","recalls",",","such","as","recall","@","100",",","recall","@","1000",".","Default",":","(","100",",","300",",","1000",")",".","iou_thrs","(","Sequence","[","float","]",")",":","IoU","threshold","used","for","evaluating","recalls",".","If","set","to","a","list",",","the","average","recall","of","all","IoUs","will","also","be","computed",".","Default",":","0.5",".","Returns",":","dict","[","str",",","float","]",":","COCO","style","evaluation","metric","or","cityscapes","mAP","and","AP","@","50","."]
code: def evaluate(
      self,
      results,
      metric="bbox",
      logger=None,
      outfile_prefix=None,
      classwise=False,
      proposal_nums=(100, 300, 1000),
      iou_thrs=np.arange(0.5, 0.96, 0.05),
  ):
      """Evaluation in Cityscapes/COCO protocol.
  
          Args:
              results (list[list | tuple]): Testing results of the dataset.
              metric (str | list[str]): Metrics to be evaluated. Options are
                  'bbox', 'segm', 'proposal', 'proposal_fast'.
              logger (logging.Logger | str | None): Logger used for printing
                  related information during evaluation. Default: None.
              outfile_prefix (str | None): The prefix of output file. It includes
                  the file path and the prefix of filename, e.g., "a/b/prefix".
                  If results are evaluated with COCO protocol, it would be the
                  prefix of output json file. For example, the metric is 'bbox'
                  and 'segm', then json files would be "a/b/prefix.bbox.json" and
                  "a/b/prefix.segm.json".
                  If results are evaluated with cityscapes protocol, it would be
                  the prefix of output txt/png files. The output files would be
                  png images under folder "a/b/prefix/xxx/" and the file name of
                  images would be written into a txt file
                  "a/b/prefix/xxx_pred.txt", where "xxx" is the video name of
                  cityscapes. If not specified, a temp file will be created.
                  Default: None.
              classwise (bool): Whether to evaluating the AP for each class.
              proposal_nums (Sequence[int]): Proposal number used for evaluating
                  recalls, such as recall@100, recall@1000.
                  Default: (100, 300, 1000).
              iou_thrs (Sequence[float]): IoU threshold used for evaluating
                  recalls. If set to a list, the average recall of all IoUs will
                  also be computed. Default: 0.5.
  
          Returns:
              dict[str, float]: COCO style evaluation metric or cityscapes mAP \
                  and AP@50.
          """
      eval_results = dict()
  
      metrics = metric.copy() if isinstance(metric, list) else [metric]
  
      if "cityscapes" in metrics:
          eval_results.update(
              self._evaluate_cityscapes(results, outfile_prefix, logger)
          )
          metrics.remove("cityscapes")
  
      # left metrics are all coco metric
      if len(metrics) > 0:
          # create CocoDataset with CityscapesDataset annotation
          self_coco = CocoDataset(
              self.ann_file,
              self.pipeline.transforms,
              None,
              self.data_root,
              self.img_prefix,
              self.seg_prefix,
              self.proposal_file,
              self.test_mode,
              self.filter_empty_gt,
          )
          # TODO: remove this in the future
          # reload annotations of correct class
          self_coco.CLASSES = self.CLASSES
          self_coco.data_infos = self_coco.load_annotations(
              self.ann_file
          )
          eval_results.update(
              self_coco.evaluate(
                  results,
                  metrics,
                  logger,
                  outfile_prefix,
                  classwise,
                  proposal_nums,
                  iou_thrs,
              )
          )
  
      return eval_results
  
file_path: insightface/detection/scrfd/mmdet/datasets/cityscapes.py
imports: import glob
  import os
  import os.path
  import tempfile
  from collections import OrderedDict
  import mmcv
  import numpy
  import pycocotools.mask
  from mmcv.utils import print_log
  from .builder import DATASETS
  from .coco import CocoDataset
label_desc: Use image node_id 5 for calling the CityscapesDataset obj's underlying member method code with example usage: obj.evaluate(results, metric, logger, outfile_prefix, classwise, proposal_nums, iou_thrs) and returns: eval_results