class_docstr: CrowdHuman evaluation metric.
  
  Evaluate Average Precision (AP), Miss Rate (MR) and Jaccard Index (JI)
  for detection tasks.
  
  Args:
      ann_file (str): Path to the annotation file.
      metric (str | List[str]): Metrics to be evaluated. Valid metrics
          include 'AP', 'MR' and 'JI'. Defaults to 'AP'.
      format_only (bool): Format the output results without perform
          evaluation. It is useful when you want to format the result
          to a specific format and submit it to the test server.
          Defaults to False.
      outfile_prefix (str, optional): The prefix of json files. It includes
          the file path and the prefix of filename, e.g., "a/b/prefix".
          If not specified, a temp file will be created. Defaults to None.
      file_client_args (dict, optional): Arguments to instantiate the
          corresponding backend in mmdet <= 3.0.0rc6. Defaults to None.
      backend_args (dict, optional): Arguments to instantiate the
          corresponding backend. Defaults to None.
      collect_device (str): Device name used for collecting results from
          different ranks during distributed training. Must be 'cpu' or
          'gpu'. Defaults to 'cpu'.
      prefix (str, optional): The prefix that will be added in the metric
          names to disambiguate homonymous metrics of different evaluators.
          If prefix is not provided in the argument, self.default_prefix
          will be used instead. Defaults to None.
      eval_mode (int): Select the mode of evaluate. Valid mode include
          0(just body box), 1(just head box) and 2(both of them).
          Defaults to 0.
      iou_thres (float): IoU threshold. Defaults to 0.5.
      compare_matching_method (str, optional): Matching method to compare
          the detection results with the ground_truth when compute 'AP'
          and 'MR'.Valid method include VOC and None(CALTECH). Default to
          None.
      mr_ref (str): Different parameter selection to calculate MR. Valid
          ref include CALTECH_-2 and CALTECH_-4. Defaults to CALTECH_-2.
      num_ji_process (int): The number of processes to evaluation JI.
          Defaults to 10.
docstr: Evaluate by Caltech-style log-average miss rate.
  
  Args:
      score_list(list[tuple[ndarray, int, str]]): Matching result.
          a list of tuples (dtbox, label, imgID) in the descending
          sort of dtbox.score.
      gt_num(int): The number of gt boxes in the entire dataset.
      img_num(int): The number of image in the entire dataset.
  
  Returns:
      mr(float): result of miss rate.
code: def eval_mr(self, score_list, gt_num, img_num):
      """Evaluate by Caltech-style log-average miss rate.
  
      Args:
          score_list(list[tuple[ndarray, int, str]]): Matching result.
              a list of tuples (dtbox, label, imgID) in the descending
              sort of dtbox.score.
          gt_num(int): The number of gt boxes in the entire dataset.
          img_num(int): The number of image in the entire dataset.
  
      Returns:
          mr(float): result of miss rate.
      """
  
      # find greater_than
      def _find_gt(lst, target):
          for idx, _item in enumerate(lst):
              if _item >= target:
                  return idx
          return len(lst) - 1
  
      if self.mr_ref == "CALTECH_-2":
          # CALTECH_MRREF_2: anchor points (from 10^-2 to 1) as in
          # P.Dollar's paper
          ref = [
              0.0100,
              0.0178,
              0.03160,
              0.0562,
              0.1000,
              0.1778,
              0.3162,
              0.5623,
              1.000,
          ]
      else:
          # CALTECH_MRREF_4: anchor points (from 10^-4 to 1) as in
          # S.Zhang's paper
          ref = [
              0.0001,
              0.0003,
              0.00100,
              0.0032,
              0.0100,
              0.0316,
              0.1000,
              0.3162,
              1.000,
          ]
  
      tp, fp = 0.0, 0.0
      fppiX, fppiY = list(), list()
      for i, item in enumerate(score_list):
          if item[1] == 1:
              tp += 1.0
          elif item[1] == 0:
              fp += 1.0
  
          fn = gt_num - tp
          recall = tp / (tp + fn)
          missrate = 1.0 - recall
          fppi = fp / img_num
          fppiX.append(fppi)
          fppiY.append(missrate)
  
      score = list()
      for pos in ref:
          argmin = _find_gt(fppiX, pos)
          if argmin >= 0:
              score.append(fppiY[argmin])
      score = np.array(score)
      mr = np.exp(np.log(score).mean())
      return mr
  
imports: import copy
  import json
  import os.path
  import tempfile
  from collections import OrderedDict
  from multiprocessing import Process, Queue
  from typing import Dict, List, Optional, Sequence, Union
  import numpy
  from mmengine.evaluator import BaseMetric
  from mmengine.fileio import dump, get_text, load
  from mmengine.logging import MMLogger
  from scipy.sparse import csr_matrix
  from scipy.sparse.csgraph import maximum_bipartite_matching
  from mmdet.evaluation.functional.bbox_overlaps import bbox_overlaps
  from mmdet.registry import METRICS
label_desc: Use image node_id 8 for calling the CrowdHumanMetric obj's underlying member method code with example usage: obj.eval_mr(score_list, gt_num, img_num) and returns: mr, unknown, idx