class_docstr: Data structure for evaluation of CrowdHuman.
  
  Note:
      This implementation is modified from https://github.com/Purkialo/
      CrowdDet/blob/master/lib/evaluate/APMRToolkits/image.py
  
  Args:
      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.
docstr: Make sure boxes are within the image range.
code: def clip_all_boader(self):
      """Make sure boxes are within the image range."""
  
      def _clip_boundary(boxes, height, width):
          assert boxes.shape[-1] >= 4
          boxes[:, 0] = np.minimum(
              np.maximum(boxes[:, 0], 0), width - 1
          )
          boxes[:, 1] = np.minimum(
              np.maximum(boxes[:, 1], 0), height - 1
          )
          boxes[:, 2] = np.maximum(np.minimum(boxes[:, 2], width), 0)
          boxes[:, 3] = np.maximum(np.minimum(boxes[:, 3], height), 0)
          return boxes
  
      assert self.dt_boxes.shape[-1] >= 4
      assert self.gt_boxes.shape[-1] >= 4
      assert self.width is not None and self.height is not None
      if self.eval_mode == 2:
          self.dt_boxes[:, :4] = _clip_boundary(
              self.dt_boxes[:, :4], self.height, self.width
          )
          self.gt_boxes[:, :4] = _clip_boundary(
              self.gt_boxes[:, :4], self.height, self.width
          )
          self.dt_boxes[:, 4:8] = _clip_boundary(
              self.dt_boxes[:, 4:8], self.height, self.width
          )
          self.gt_boxes[:, 4:8] = _clip_boundary(
              self.gt_boxes[:, 4:8], self.height, self.width
          )
      else:
          self.dt_boxes = _clip_boundary(
              self.dt_boxes, self.height, self.width
          )
          self.gt_boxes = _clip_boundary(
              self.gt_boxes, self.height, self.width
          )
  
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 5 for calling the Image obj's underlying member method code with example usage: obj.clip_all_boader() and returns: boxes