class_docstr: Distributed evaluation hook.
  
  Notes:
      If new arguments are added, tools/test.py may be effected.
  
  Attributes:
      dataloader (DataLoader): A PyTorch dataloader.
      start (int, optional): Evaluation starting epoch. It enables evaluation
          before the training starts if ``start`` <= the resuming epoch.
          If None, whether to evaluate is merely decided by ``interval``.
          Default: None.
      interval (int): Evaluation interval (by epochs). Default: 1.
      tmpdir (str | None): Temporary directory to save the results of all
          processes. Default: None.
      gpu_collect (bool): Whether to use gpu or cpu to collect results.
          Default: False.
      save_best (str, optional): If a metric is specified, it would measure
          the best checkpoint during evaluation. The information about best
          checkpoint would be save in best.json.
          Options are the evaluation metrics to the test dataset. e.g.,
          ``bbox_mAP``, ``segm_mAP`` for bbox detection and instance
          segmentation. ``AR@100`` for proposal recall. If ``save_best`` is
          ``auto``, the first key will be used. The interval of
          ``CheckpointHook`` should device EvalHook. Default: None.
      rule (str | None): Comparison rule for best score. If set to None,
          it will infer a reasonable rule. Default: 'None'.
      **eval_kwargs: Evaluation arguments fed into the evaluate function of
          the dataset.
class_docstr_tok: ["Distributed","evaluation","hook",".","Notes",":","If","new","arguments","are","added",",","tools\/test.py","may","be","effected",".","Attributes",":","dataloader","(","DataLoader",")",":","A","PyTorch","dataloader",".","start","(","int",",","optional",")",":","Evaluation","starting","epoch",".","It","enables","evaluation","before","the","training","starts","if","``","start","``","<","=","the","resuming","epoch",".","If","None",",","whether","to","evaluate","is","merely","decided","by","``","interval","``",".","Default",":","None",".","interval","(","int",")",":","Evaluation","interval","(","by","epochs",")",".","Default",":","1.","tmpdir","(","str","|","None",")",":","Temporary","directory","to","save","the","results","of","all","processes",".","Default",":","None",".","gpu_collect","(","bool",")",":","Whether","to","use","gpu","or","cpu","to","collect","results",".","Default",":","False",".","save_best","(","str",",","optional",")",":","If","a","metric","is","specified",",","it","would","measure","the","best","checkpoint","during","evaluation",".","The","information","about","best","checkpoint","would","be","save","in","best.json",".","Options","are","the","evaluation","metrics","to","the","test","dataset",".","e.g.",",","``","bbox_mAP","``",",","``","segm_mAP","``","for","bbox","detection","and","instance","segmentation",".","``","AR","@","100","``","for","proposal","recall",".","If","``","save_best","``","is","``","auto","``",",","the","first","key","will","be","used",".","The","interval","of","``","CheckpointHook","``","should","device","EvalHook",".","Default",":","None",".","rule","(","str","|","None",")",":","Comparison","rule","for","best","score",".","If","set","to","None",",","it","will","infer","a","reasonable","rule",".","Default",":","'None","'",".","*","*","eval_kwargs",":","Evaluation","arguments","fed","into","the","evaluate","function","of","the","dataset","."]
code: def __init__(
      self,
      dataloader,
      start=None,
      interval=1,
      tmpdir=None,
      gpu_collect=False,
      save_best=None,
      rule=None,
      **eval_kwargs,
  ):
      super().__init__(
          dataloader,
          start=start,
          interval=interval,
          save_best=save_best,
          rule=rule,
          **eval_kwargs,
      )
      self.tmpdir = tmpdir
      self.gpu_collect = gpu_collect
  
file_path: insightface/detection/scrfd/mmdet/core/evaluation/eval_hooks.py
imports: import os.path
  import warnings
  from math import inf
  import mmcv
  from mmcv.runner import Hook
  from torch.utils.data import DataLoader
  from mmdet.utils import get_root_logger
label_desc: Use image node_id 1 to create a new DistEvalHook object from inherited base classes: EvalHook with example: obj = DistEvalHook(dataloader, start, interval, tmpdir, gpu_collect, save_best, rule)