class_docstr: Evaluation hook.
  
  Notes:
      If new arguments are added for EvalHook, tools/test.py,
      tools/eval_metric.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.
      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, optional): Comparison rule for best score. If set to None,
          it will infer a reasonable rule. Keys such as 'mAP' or 'AR' will
          be inferred by 'greater' rule. Keys contain 'loss' will be inferred
           by 'less' rule. Options are 'greater', 'less'. Default: None.
      **eval_kwargs: Evaluation arguments fed into the evaluate function of
          the dataset.
class_docstr_tok: ["Evaluation","hook",".","Notes",":","If","new","arguments","are","added","for","EvalHook",",","tools\/test.py",",","tools\/eval_metric.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.","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",",","optional",")",":","Comparison","rule","for","best","score",".","If","set","to","None",",","it","will","infer","a","reasonable","rule",".","Keys","such","as","'mAP","'","or","'AR","'","will","be","inferred","by","'greater","'","rule",".","Keys","contain","'loss","'","will","be","inferred","by","'less","'","rule",".","Options","are","'greater","'",",","'less","'",".","Default",":","None",".","*","*","eval_kwargs",":","Evaluation","arguments","fed","into","the","evaluate","function","of","the","dataset","."]
docstr: Judge whether to perform_evaluation after this epoch.
  
  Returns:
      bool: The flag indicating whether to perform evaluation.
docstr_tok: ["Judge","whether","to","perform_evaluation","after","this","epoch",".","Returns",":","bool",":","The","flag","indicating","whether","to","perform","evaluation","."]
code: def evaluation_flag(self, runner):
      """Judge whether to perform_evaluation after this epoch.
  
      Returns:
          bool: The flag indicating whether to perform evaluation.
      """
      if self.start is None:
          if not self.every_n_epochs(runner, self.interval):
              # No evaluation during the interval epochs.
              return False
      elif (runner.epoch + 1) < self.start:
          # No evaluation if start is larger than the current epoch.
          return False
      else:
          # Evaluation only at epochs 3, 5, 7... if start==3 and interval==2
          if (runner.epoch + 1 - self.start) % self.interval:
              return False
      return True
  
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 5 for calling the EvalHook obj's underlying member method code with example usage: obj.evaluation_flag(runner) and returns: True, False, False, False