class_docstr: Non-Distributed evaluation hook.
  
  This hook will regularly perform evaluation in a given interval when
  performing in non-distributed environment.
  
  Args:
      dataloader (DataLoader): A PyTorch dataloader, whose dataset has
          implemented ``evaluate`` function.
      start (int | None, 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. Default: 1.
      by_epoch (bool): Determine perform evaluation by epoch or by iteration.
          If set to True, it will perform by epoch. Otherwise, by iteration.
          Default: True.
      save_best (str, optional): If a metric is specified, it would measure
          the best checkpoint during evaluation. The information about best
          checkpoint would be saved in ``runner.meta['hook_msgs']`` to keep
          best score value and best checkpoint path, which will be also
          loaded when resume checkpoint. Options are the evaluation metrics
          on 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 of the returned
          ``OrderedDict`` result will be used. Default: None.
      rule (str | None, optional): Comparison rule for best score. If set to
          None, it will infer a reasonable rule. Keys such as 'acc', 'top'
          .etc will be inferred by 'greater' rule. Keys contain 'loss' will
          be inferred by 'less' rule. Options are 'greater', 'less', None.
          Default: None.
      test_fn (callable, optional): test a model with samples from a
          dataloader, and return the test results. If ``None``, the default
          test function ``mmcv.engine.single_gpu_test`` will be used.
          (default: ``None``)
      greater_keys (List[str] | None, optional): Metric keys that will be
          inferred by 'greater' comparison rule. If ``None``,
          _default_greater_keys will be used. (default: ``None``)
      less_keys (List[str] | None, optional): Metric keys that will be
          inferred by 'less' comparison rule. If ``None``, _default_less_keys
          will be used. (default: ``None``)
      out_dir (str, optional): The root directory to save checkpoints. If not
          specified, `runner.work_dir` will be used by default. If specified,
          the `out_dir` will be the concatenation of `out_dir` and the last
          level directory of `runner.work_dir`.
          `New in version 1.3.16.`
      file_client_args (dict): Arguments to instantiate a FileClient.
          See :class:`mmcv.fileio.FileClient` for details. Default: None.
          `New in version 1.3.16.`
      **eval_kwargs: Evaluation arguments fed into the evaluate function of
          the dataset.
  
  Notes:
      If new arguments are added for EvalHook, tools/test.py,
      tools/eval_metric.py may be affected.
class_docstr_tok: ["Non-Distributed","evaluation","hook",".","This","hook","will","regularly","perform","evaluation","in","a","given","interval","when","performing","in","non-distributed","environment",".","Args",":","dataloader","(","DataLoader",")",":","A","PyTorch","dataloader",",","whose","dataset","has","implemented","``","evaluate","``","function",".","start","(","int","|","None",",","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",".","Default",":","1.","by_epoch","(","bool",")",":","Determine","perform","evaluation","by","epoch","or","by","iteration",".","If","set","to","True",",","it","will","perform","by","epoch",".","Otherwise",",","by","iteration",".","Default",":","True",".","save_best","(","str",",","optional",")",":","If","a","metric","is","specified",",","it","would","measure","the","best","checkpoint","during","evaluation",".","The","information","about","best","checkpoint","would","be","saved","in","``","runner.meta","[","'hook_msgs","'","]","``","to","keep","best","score","value","and","best","checkpoint","path",",","which","will","be","also","loaded","when","resume","checkpoint",".","Options","are","the","evaluation","metrics","on","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","of","the","returned","``","OrderedDict","``","result","will","be","used",".","Default",":","None",".","rule","(","str","|","None",",","optional",")",":","Comparison","rule","for","best","score",".","If","set","to","None",",","it","will","infer","a","reasonable","rule",".","Keys","such","as","'acc","'",",","'top'",".etc","will","be","inferred","by","'greater","'","rule",".","Keys","contain","'loss","'","will","be","inferred","by","'less","'","rule",".","Options","are","'greater","'",",","'less","'",",","None",".","Default",":","None",".","test_fn","(","callable",",","optional",")",":","test","a","model","with","samples","from","a","dataloader",",","and","return","the","test","results",".","If","``","None","``",",","the","default","test","function","``","mmcv.engine.single_gpu_test","``","will","be","used",".","(","default",":","``","None","``",")","greater_keys","(","List","[","str","]","|","None",",","optional",")",":","Metric","keys","that","will","be","inferred","by","'greater","'","comparison","rule",".","If","``","None","``",",","_default_greater_keys","will","be","used",".","(","default",":","``","None","``",")","less_keys","(","List","[","str","]","|","None",",","optional",")",":","Metric","keys","that","will","be","inferred","by","'less","'","comparison","rule",".","If","``","None","``",",","_default_less_keys","will","be","used",".","(","default",":","``","None","``",")","out_dir","(","str",",","optional",")",":","The","root","directory","to","save","checkpoints",".","If","not","specified",",","`","runner.work_dir","`","will","be","used","by","default",".","If","specified",",","the","`","out_dir","`","will","be","the","concatenation","of","`","out_dir","`","and","the","last","level","directory","of","`","runner.work_dir","`",".","`","New","in","version","1.3.16.","`","file_client_args","(","dict",")",":","Arguments","to","instantiate","a","FileClient",".","See",":","class",":","`","mmcv.fileio.FileClient","`","for","details",".","Default",":","None",".","`","New","in","version","1.3.16.","`","*","*","eval_kwargs",":","Evaluation","arguments","fed","into","the","evaluate","function","of","the","dataset",".","Notes",":","If","new","arguments","are","added","for","EvalHook",",","tools\/test.py",",","tools\/eval_metric.py","may","be","affected","."]
docstr: Judge whether to perform evaluation.
  
  Here is the rule to judge whether to perform evaluation:
  1. It will not perform evaluation during the epoch/iteration interval,
     which is determined by ``self.interval``.
  2. It will not perform evaluation if the start time is larger than
     current time.
  3. It will not perform evaluation when current time is larger than
     the start time but during epoch/iteration interval.
  
  Returns:
      bool: The flag indicating whether to perform evaluation.
docstr_tok: ["Judge","whether","to","perform","evaluation",".","Here","is","the","rule","to","judge","whether","to","perform","evaluation",":","1",".","It","will","not","perform","evaluation","during","the","epoch\/iteration","interval",",","which","is","determined","by","``","self.interval","``",".","2",".","It","will","not","perform","evaluation","if","the","start","time","is","larger","than","current","time",".","3",".","It","will","not","perform","evaluation","when","current","time","is","larger","than","the","start","time","but","during","epoch\/iteration","interval",".","Returns",":","bool",":","The","flag","indicating","whether","to","perform","evaluation","."]
code: def _should_evaluate(self, runner):
      """Judge whether to perform evaluation.
  
      Here is the rule to judge whether to perform evaluation:
      1. It will not perform evaluation during the epoch/iteration interval,
         which is determined by ``self.interval``.
      2. It will not perform evaluation if the start time is larger than
         current time.
      3. It will not perform evaluation when current time is larger than
         the start time but during epoch/iteration interval.
  
      Returns:
          bool: The flag indicating whether to perform evaluation.
      """
      if self.by_epoch:
          current = runner.epoch
          check_time = self.every_n_epochs
      else:
          current = runner.iter
          check_time = self.every_n_iters
  
      if self.start is None:
          if not check_time(runner, self.interval):
              # No evaluation during the interval.
              return False
      elif (current + 1) < self.start:
          # No evaluation if start is larger than the current time.
          return False
      else:
          # Evaluation only at epochs/iters 3, 5, 7...
          # if start==3 and interval==2
          if (current + 1 - self.start) % self.interval:
              return False
      return True
  
imports: import os.path
  import warnings
  from math import inf
  import torch.distributed
  from torch.nn.modules.batchnorm import _BatchNorm
  from torch.utils.data import DataLoader
  from annotator.uniformer.mmcv.fileio import FileClient
  from annotator.uniformer.mmcv.utils import is_seq_of
  from .hook import Hook
  from .logger import LoggerHook
label_desc: Use image node_id 9 for calling the EvalHook obj's underlying member method code with example usage: obj._should_evaluate(runner) and returns: True, False, False, False